summaryrefslogtreecommitdiff
path: root/std
diff options
context:
space:
mode:
authorKevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com>2019-12-11 21:02:23 -0800
committerRy Dahl <ry@tinyclouds.org>2019-12-12 13:02:23 +0800
commitd146d45861708bcf1879563a545a2c8b8f96bd80 (patch)
treed3b2f533dc9280cdda94eda938dc56ad6a8d318f /std
parentef174883985d764d727002be004a113968922013 (diff)
benchmark: align deno_http and node_http response (#3484)
Diffstat (limited to 'std')
-rw-r--r--std/http/http_bench.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/std/http/http_bench.ts b/std/http/http_bench.ts
index 462e15e0e..7b38e742a 100644
--- a/std/http/http_bench.ts
+++ b/std/http/http_bench.ts
@@ -7,5 +7,11 @@ const body = new TextEncoder().encode("Hello World");
console.log(`http://${addr}/`);
for await (const req of server) {
- req.respond({ body });
+ const res = {
+ body,
+ headers: new Headers()
+ };
+ res.headers.set("Date", new Date().toUTCString());
+ res.headers.set("Connection", "keep-alive");
+ req.respond(res).catch(() => {});
}