From 7fd9444728e1e509630f5ba0f50e7f9da150369c Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Tue, 6 Aug 2019 16:24:11 +0300 Subject: Node.js: returning "this" from writeHead() to allow chaining. In Node.js version 11.10.0 and later, the writeHead() function returns "this". --- test/node/mirror/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/node/mirror/app.js') diff --git a/test/node/mirror/app.js b/test/node/mirror/app.js index abcb87cb..1488917e 100755 --- a/test/node/mirror/app.js +++ b/test/node/mirror/app.js @@ -6,7 +6,7 @@ require('unit-http').createServer(function (req, res) { body += chunk.toString(); }); req.on('end', () => { - res.writeHead(200, {'Content-Length': Buffer.byteLength(body)}); - res.end(body); + res.writeHead(200, {'Content-Length': Buffer.byteLength(body)}) + .end(body); }); }).listen(7080); -- cgit