Permalink
Browse files

bench: add /echo endpoint to http_simple

Copies the POST request data verbatim into the response body.
  • Loading branch information...
1 parent 432a2e4 commit 8b2abed03df9bc16b37d1ac21bfc68b36dfa9f47 @bnoordhuis bnoordhuis committed Dec 30, 2011
Showing with 6 additions and 0 deletions.
  1. +6 −0 benchmark/http_simple.js
@@ -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";

0 comments on commit 8b2abed

Please sign in to comment.