-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: #26366 PR-URL: #26402 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
- Loading branch information
1 parent
9f5ad9b
commit cb88c58
Showing
2 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); |