Skip to content

Commit

Permalink
Merge pull request #182 from chirigg/patch-1
Browse files Browse the repository at this point in the history
fix: internals.timeout (http.js) when socket is null
  • Loading branch information
rjrodger authored Oct 14, 2024
2 parents e94323b + a952f80 commit 7ee7a11
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,5 +357,9 @@ internals.timeout = function (listenOptions, req, res) {
req.once('close', clearTimeoutId)
req.once('error', clearTimeoutId)
res.once('error', clearTimeoutId)
res.socket.once('data', clearTimeoutId)
if (res.socket) {
res.socket.once('data', clearTimeoutId)
} else {
clearTimeoutId()
}
}

0 comments on commit 7ee7a11

Please sign in to comment.