-
Notifications
You must be signed in to change notification settings - Fork 30k
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: fix IPv6 Host header check #13122
Conversation
ede16b8
to
d497722
Compare
Windows fail:
@mscdex need assistance on the Windows front? |
d497722
to
fb2a7aa
Compare
It's passing now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 lite suggestions
this.close(); | ||
}, 2)).listen(0, function() { | ||
const address = this.address(); | ||
http.get({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you parameterize the literal 2
s, and add a comment here that these are the N
connection attempts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
if (-1 !== (posColon = hostHeader.indexOf(':')) && | ||
-1 !== (posColon = hostHeader.indexOf(':', posColon)) && | ||
'[' !== hostHeader[0]) { | ||
var posColon = hostHeader.indexOf(':'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was sticking to the "style" of the original code. I'm also still reluctant to use const
in runtime code because I've been burned so many times by it in the past (even when it hasn't triggered a permanent deopt).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack. Although before it was assigned to, and now it's just initiated.
fb2a7aa
to
ae64ec9
Compare
New CI after test changes: https://ci.nodejs.org/job/node-test-pull-request/8238/ EDIT: CI is green. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even Better.
PR-URL: nodejs#13122 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
ae64ec9
to
3774c99
Compare
PR-URL: #13122 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
PR-URL: #13122 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Should this be backported to v6.x? |
ping @mscdex |
Possibly, but I won't have time to backport anytime soon. |
ping re: backport |
CI: https://ci.nodejs.org/job/node-test-pull-request/8203/
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)