Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2011-12-30 05:03:08 +0400
committerBen Noordhuis <info@bnoordhuis.nl>2011-12-30 05:03:10 +0400
commit8b2abed03df9bc16b37d1ac21bfc68b36dfa9f47 (patch)
tree8a8c24f814e1dd31d65306021d4a803d0577e161 /benchmark
parent432a2e4d397908965cfbdc44eb8a10c7fb840701 (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.js6
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";