Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_http_common ParserIncomingMessage fails to check for undefined on parser.socket.server[kIncomingMessage] #20151

Closed
nyxtom opened this issue Apr 19, 2018 · 1 comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. http Issues or PRs related to the http subsystem.

Comments

@nyxtom
Copy link

nyxtom commented Apr 19, 2018

node/lib/_http_common.js

Lines 78 to 82 in 15e41a9

var ParserIncomingMessage = parser.socket && parser.socket.server ?
parser.socket.server[kIncomingMessage] : IncomingMessage;
parser.incoming = new ParserIncomingMessage(parser.socket);
parser.incoming.httpVersionMajor = versionMajor;

Due to this line of code, if parser.socket.server[kIncomingMessage] is undefined, an error will be thrown on the line below where the ParserIncomingMessage is constructed. A simple additional check here would solve this issue. A few libraries have cropped this up in socket.io, ws and some others that weren't happening in previous versions of node.

Node version: 9.6.0
Platform: OSX

@apapirovski
Copy link
Member

apapirovski commented Apr 19, 2018

This will be in the 10.0.0 release. See #20029 for a fix.

Duplicate of #19231

@apapirovski apapirovski added http Issues or PRs related to the http subsystem. duplicate Issues and PRs that are duplicates of other issues or PRs. labels Apr 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. http Issues or PRs related to the http subsystem.
Projects
None yet
Development

No branches or pull requests

2 participants