mirror of https://github.com/nodejs/node.git
bench: add /echo endpoint to http_simple
Copies the POST request data verbatim into the response body.pull/5370/head
parent
432a2e4d39
commit
8b2abed03d
|
@ -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";
|
||||
|
|
Loading…
Reference in New Issue