summaryrefslogtreecommitdiff
path: root/lib/_http_server.js
diff options
context:
space:
mode:
authorMatteo Collina <hello@matteocollina.com>2019-03-02 19:09:44 +0100
committerMatteo Collina <hello@matteocollina.com>2019-03-06 14:32:39 +0000
commit3c83f934378ca1af517cbf35981e59ede877c0ec (patch)
tree19a197e75b26e885bb94b27624edaeaf1424aa23 /lib/_http_server.js
parent3770ab99a8a976542a9ecb90ab2e24393e0d642d (diff)
downloadandroid-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 'lib/_http_server.js')
-rw-r--r--lib/_http_server.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/_http_server.js b/lib/_http_server.js
index 02cd7a81a9..53bf30b3d2 100644
--- a/lib/_http_server.js
+++ b/lib/_http_server.js
@@ -755,7 +755,7 @@ function resetHeadersTimeoutOnReqEnd() {
const parser = this.socket.parser;
// Parser can be null if the socket was destroyed
// in that case, there is nothing to do.
- if (parser !== null) {
+ if (parser) {
parser.parsingHeadersStart = nowDate();
}
}