From 8b2abed03df9bc16b37d1ac21bfc68b36dfa9f47 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 30 Dec 2011 02:03:08 +0100 Subject: [PATCH] bench: add /echo endpoint to http_simple Copies the POST request data verbatim into the response body. --- benchmark/http_simple.js | 6 ++++++ 1 file changed, 6 insertions(+) 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";