Skip to content

Commit 8b2abed

Browse files
committed
bench: add /echo endpoint to http_simple
Copies the POST request data verbatim into the response body.
1 parent 432a2e4 commit 8b2abed

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

benchmark/http_simple.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ var server = http.createServer(function (req, res) {
5454
} else if (command == "fixed") {
5555
body = fixed;
5656

57+
} else if (command == "echo") {
58+
res.writeHead(200, { "Content-Type": "text/plain",
59+
"Transfer-Encoding": "chunked" });
60+
req.pipe(res);
61+
return;
62+
5763
} else {
5864
status = 404;
5965
body = "not found\n";

0 commit comments

Comments
 (0)