diff options
author | Matteo Collina <hello@matteocollina.com> | 2019-03-02 19:09:44 +0100 |
---|---|---|
committer | Matteo Collina <hello@matteocollina.com> | 2019-03-06 14:32:39 +0000 |
commit | 3c83f934378ca1af517cbf35981e59ede877c0ec (patch) | |
tree | 19a197e75b26e885bb94b27624edaeaf1424aa23 /test/parallel/test-http-server-delete-parser.js | |
parent | 3770ab99a8a976542a9ecb90ab2e24393e0d642d (diff) | |
download | android-node-v8-3c83f934378ca1af517cbf35981e59ede877c0ec.tar.gz android-node-v8-3c83f934378ca1af517cbf35981e59ede877c0ec.tar.bz2 android-node-v8-3c83f934378ca1af517cbf35981e59ede877c0ec.zip |
http: check for existance in resetHeadersTimeoutOnReqEnd
socket.parser can be undefined under unknown circumstances.
This is a fix for a bug I cannot reproduce but it is affecting
people.
Fixes: https://github.com/nodejs/node/issues/26366
PR-URL: https://github.com/nodejs/node/pull/26402
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'test/parallel/test-http-server-delete-parser.js')
-rw-r--r-- | test/parallel/test-http-server-delete-parser.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/parallel/test-http-server-delete-parser.js b/test/parallel/test-http-server-delete-parser.js new file mode 100644 index 0000000000..0c5eea9073 --- /dev/null +++ b/test/parallel/test-http-server-delete-parser.js @@ -0,0 +1,24 @@ +'use strict'; + +const common = require('../common'); + +const http = require('http'); + +const server = http.createServer(common.mustCall((req, res) => { + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.write('okay', common.mustCall(() => { + delete res.socket.parser; + })); + res.end(); +})); + +server.listen(1337, '127.0.0.1'); +server.unref(); + +const req = http.request({ + port: 1337, + host: '127.0.0.1', + method: 'GET', +}); + +req.end(); |