1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-30 16:40:57 -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 Yoshiya Hinosawa
parent beff2f81eb
commit f98cc1cad4
No known key found for this signature in database
GPG key ID: 0E8BFAA8A5B4E92B
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 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!"));
Bun.serve({

View file

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

View file

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