summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--std/http/http_bench.ts8
-rw-r--r--tools/node_http.js2
2 files changed, 8 insertions, 2 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(() => {});
}
diff --git a/tools/node_http.js b/tools/node_http.js
index 2439cfc43..5587f6c3c 100644
--- a/tools/node_http.js
+++ b/tools/node_http.js
@@ -4,6 +4,6 @@ const port = process.argv[2] || "4544";
console.log("port", port);
http
.Server((req, res) => {
- res.end("Hello World\n");
+ res.end("Hello World");
})
.listen(port);