1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 15:24:46 -05:00

fix(bench): make sure bytes/response is equal (#15763)

This commit is contained in:
Divy Srivastava 2022-09-04 18:29:38 +05:30 committed by GitHub
parent e324151520
commit 50fc5d169a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View file

@ -3,6 +3,10 @@ const port = Bun.argv[2] || "4545";
const { Hono } = require("../testdata/npm/hono/dist/index.js"); const { Hono } = require("../testdata/npm/hono/dist/index.js");
const app = new Hono(); const app = new Hono();
app.use("*", async (c, n) => {
c.res.headers.set("Date", (new Date()).toUTCString());
await n();
});
app.get("/", (c) => c.text("Hello, World!")); app.get("/", (c) => c.text("Hello, World!"));
Bun.serve({ Bun.serve({

View file

@ -2,7 +2,9 @@
const port = Bun.argv[2] || "4545"; const port = Bun.argv[2] || "4545";
Bun.serve({ Bun.serve({
fetch(_req) { fetch(_req) {
return new Response("Hello World"); return new Response("Hello World", {
headers: { "Date": (new Date()).toUTCString() },
});
}, },
port: Number(port), port: Number(port),
}); });

View file

@ -6,7 +6,9 @@ const path = new URL("../testdata/128k.bin", import.meta.url).pathname;
Bun.serve({ Bun.serve({
fetch(_req) { fetch(_req) {
const file = Bun.file(path); const file = Bun.file(path);
return new Response(file); return new Response(file, {
headers: { "Date": (new Date()).toUTCString() },
});
}, },
port: Number(port), port: Number(port),
}); });