mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
bench: add /echo endpoint to http_simple
Copies the POST request data verbatim into the response body.
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user