bench: add /echo endpoint to http_simple

Copies the POST request data verbatim into the response body.
This commit is contained in:
Ben Noordhuis
2011-12-30 02:03:08 +01:00
parent 432a2e4d39
commit 8b2abed03d

View File

@@ -54,6 +54,12 @@ var server = http.createServer(function (req, res) {
} else if (command == "fixed") {
body = fixed;
} else if (command == "echo") {
res.writeHead(200, { "Content-Type": "text/plain",
"Transfer-Encoding": "chunked" });
req.pipe(res);
return;
} else {
status = 404;
body = "not found\n";