diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2011-12-30 05:03:08 +0400 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2011-12-30 05:03:10 +0400 |
commit | 8b2abed03df9bc16b37d1ac21bfc68b36dfa9f47 (patch) | |
tree | 8a8c24f814e1dd31d65306021d4a803d0577e161 /benchmark | |
parent | 432a2e4d397908965cfbdc44eb8a10c7fb840701 (diff) |
bench: add /echo endpoint to http_simple
Copies the POST request data verbatim into the response body.
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/http_simple.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/benchmark/http_simple.js b/benchmark/http_simple.js index 4b550283b8a..74ba4d77680 100644 --- a/benchmark/http_simple.js +++ b/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"; |