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: fix IPv6 Host header check #13122

Merged
merged 1 commit into from May 23, 2017

Conversation

@mscdex
Copy link
Contributor

commented May 19, 2017

CI: https://ci.nodejs.org/job/node-test-pull-request/8203/

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)
  • http

@mscdex mscdex added the http label May 19, 2017

@mscdex mscdex force-pushed the mscdex:http-fix-ipv6-host-header branch May 19, 2017

@refack

This comment has been minimized.

Copy link
Member

commented May 20, 2017

Windows fail:

135	parallel/test-http-host-header-ipv6-fail	
duration_ms	0.165
severity	fail
stack	
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: connect EADDRNOTAVAIL :::59105
    at Object.exports._errnoException (util.js:1026:11)
    at exports._exceptionWithHostPort (util.js:1049:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1156:14)

@mscdex need assistance on the Windows front?

@mscdex mscdex force-pushed the mscdex:http-fix-ipv6-host-header branch May 20, 2017

@mscdex

This comment has been minimized.

Copy link
Contributor Author

commented May 20, 2017

It's passing now.

@refack
refack approved these changes May 20, 2017
Copy link
Member

left a comment

2 lite suggestions

test/parallel/test-http-host-header-ipv6-fail.js Outdated
this.close();
}, 2)).listen(0, function() {
const address = this.address();
http.get({

This comment has been minimized.

Copy link
@refack

refack May 20, 2017

Member

Could you parameterize the literal 2s, and add a comment here that these are the N connection attempts?

This comment has been minimized.

Copy link
@mscdex

mscdex May 22, 2017

Author Contributor

Done.

if (-1 !== (posColon = hostHeader.indexOf(':')) &&
-1 !== (posColon = hostHeader.indexOf(':', posColon)) &&
'[' !== hostHeader[0]) {
var posColon = hostHeader.indexOf(':');

This comment has been minimized.

Copy link
@refack

refack May 20, 2017

Member

const?

This comment has been minimized.

Copy link
@mscdex

mscdex May 20, 2017

Author Contributor

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).

This comment has been minimized.

Copy link
@refack

refack May 20, 2017

Member

Ack. Although before it was assigned to, and now it's just initiated.

@mscdex mscdex force-pushed the mscdex:http-fix-ipv6-host-header branch May 22, 2017

@mscdex

This comment has been minimized.

Copy link
Contributor Author

commented May 22, 2017

New CI after test changes: https://ci.nodejs.org/job/node-test-pull-request/8238/

EDIT: CI is green.

@refack
refack approved these changes May 22, 2017
Copy link
Member

left a comment

Even Better.

http: fix IPv6 Host header check
PR-URL: #13122
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>

@mscdex mscdex force-pushed the mscdex:http-fix-ipv6-host-header branch to 3774c99 May 23, 2017

@mscdex mscdex merged commit 3774c99 into nodejs:master May 23, 2017

@mscdex mscdex deleted the mscdex:http-fix-ipv6-host-header branch May 23, 2017

jasnell added a commit that referenced this pull request May 23, 2017
http: fix IPv6 Host header check
PR-URL: #13122
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
jasnell added a commit that referenced this pull request May 23, 2017
http: fix IPv6 Host header check
PR-URL: #13122
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
@jasnell jasnell referenced this pull request May 28, 2017
@gibfahn gibfahn referenced this pull request Jun 15, 2017
2 of 3 tasks complete
@MylesBorins

This comment has been minimized.

Copy link
Member

commented Jul 17, 2017

Should this be backported to v6.x?

@MylesBorins

This comment has been minimized.

Copy link
Member

commented Aug 14, 2017

ping @mscdex

@mscdex

This comment has been minimized.

Copy link
Contributor Author

commented Aug 14, 2017

Possibly, but I won't have time to backport anytime soon.

@MylesBorins

This comment has been minimized.

Copy link
Member

commented Jan 11, 2018

ping re: backport

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.