diff options
author | Valentin Bartenev <vbart@nginx.com> | 2019-08-06 16:24:11 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2019-08-06 16:24:11 +0300 |
commit | 7fd9444728e1e509630f5ba0f50e7f9da150369c (patch) | |
tree | 2d6c898e0508f9df7e8367eaa64072fedd2c92ac /test/node/promise_handler/app.js | |
parent | c7210eaa5a15083715cac574cce055b94860e70e (diff) | |
download | unit-7fd9444728e1e509630f5ba0f50e7f9da150369c.tar.gz unit-7fd9444728e1e509630f5ba0f50e7f9da150369c.tar.bz2 |
Node.js: returning "this" from writeHead() to allow chaining.
In Node.js version 11.10.0 and later, the writeHead() function returns "this".
Diffstat (limited to 'test/node/promise_handler/app.js')
-rwxr-xr-x | test/node/promise_handler/app.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/test/node/promise_handler/app.js b/test/node/promise_handler/app.js index 60b0c3bb..51c3666b 100755 --- a/test/node/promise_handler/app.js +++ b/test/node/promise_handler/app.js @@ -6,8 +6,7 @@ require('unit-http').createServer(function (req, res) { res.end(); if (req.headers['x-write-call']) { - res.writeHead(200, {'Content-Type': 'text/plain'}); - res.write('blah'); + res.writeHead(200, {'Content-Type': 'text/plain'}).write('blah'); } Promise.resolve().then(() => { |