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/variables/app.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'test/node/variables/app.js') diff --git a/test/node/variables/app.js b/test/node/variables/app.js index 4ed94d09..d8cdc20c 100755 --- a/test/node/variables/app.js +++ b/test/node/variables/app.js @@ -14,7 +14,6 @@ require('unit-http').createServer(function (req, res) { res.setHeader('Content-Type', req.headers['content-type']); res.setHeader('Custom-Header', req.headers['custom-header']); res.setHeader('Http-Host', req.headers['host']); - res.writeHead(200, {}); - res.end(body); + res.writeHead(200, {}).end(body); }); }).listen(7080); -- cgit