summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2011-12-30 02:03:08 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2011-12-30 02:03:10 +0100
commit8b2abed03df9bc16b37d1ac21bfc68b36dfa9f47 (patch)
tree8a8c24f814e1dd31d65306021d4a803d0577e161 /benchmark
parent432a2e4d397908965cfbdc44eb8a10c7fb840701 (diff)
downloadnode-new-8b2abed03df9bc16b37d1ac21bfc68b36dfa9f47.tar.gz
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.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/benchmark/http_simple.js b/benchmark/http_simple.js
index 4b550283b8..74ba4d7768 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";