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". --- src/nodejs/unit-http/http_server.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/nodejs/unit-http/http_server.js b/src/nodejs/unit-http/http_server.js index ae8e204a..0fe5dd34 100755 --- a/src/nodejs/unit-http/http_server.js +++ b/src/nodejs/unit-http/http_server.js @@ -195,6 +195,8 @@ function writeHead(statusCode, reason, obj) { } } } + + return this; }; /* -- cgit