mirror of
https://github.com/denoland/deno.git
synced 2024-12-01 16:51:13 -05:00
fix(bench): make sure bytes/response is equal (#15763)
This commit is contained in:
parent
beff2f81eb
commit
f98cc1cad4
3 changed files with 10 additions and 2 deletions
|
@ -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({
|
||||||
|
|
|
@ -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),
|
||||||
});
|
});
|
||||||
|
|
|
@ -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),
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue