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

http2: remove square brackets from parsed hostname #28406

Closed
wants to merge 3 commits into from

Conversation

@lpinca
Copy link
Member

commented Jun 24, 2019

Make http2.connect() work when using URLs with literal IPv6
addresses.

Fixes: #28216

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
http2: remove square brackets from parsed hostname
Make `http2.connect()` work when using URLs with literal IPv6
addresses.

Fixes: #28216
@Trott
Trott approved these changes Jun 25, 2019
lib/internal/http2/core.js Outdated Show resolved Hide resolved
@nodejs-github-bot

This comment has been minimized.

@lpinca lpinca added the author ready label Jun 25, 2019

@@ -2774,7 +2774,18 @@ function connect(authority, options, listener) {
const protocol = authority.protocol || options.protocol || 'https:';
const port = '' + (authority.port !== '' ?
authority.port : (authority.protocol === 'http:' ? 80 : 443));
const host = authority.hostname || authority.host || 'localhost';
let host = '';

This comment has been minimized.

Copy link
@gengjiawen

gengjiawen Jun 26, 2019

Member

Looks like host can be default to localhost and remove the last else ?

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@lpinca

This comment has been minimized.

Copy link
Member Author

commented Jul 1, 2019

Landed in 26b048e.

@lpinca lpinca closed this Jul 1, 2019

@lpinca lpinca deleted the lpinca:gh-28216 branch Jul 1, 2019

lpinca added a commit that referenced this pull request Jul 1, 2019
http2: remove square brackets from parsed hostname
Make `http2.connect()` work when using URLs with literal IPv6
addresses.

Fixes: #28216

PR-URL: #28406
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
targos added a commit that referenced this pull request Jul 2, 2019
http2: remove square brackets from parsed hostname
Make `http2.connect()` work when using URLs with literal IPv6
addresses.

Fixes: #28216

PR-URL: #28406
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
targos added a commit that referenced this pull request Jul 2, 2019
http2: remove square brackets from parsed hostname
Make `http2.connect()` work when using URLs with literal IPv6
addresses.

Fixes: #28216

PR-URL: #28406
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
@targos targos referenced this pull request Jul 2, 2019
@murgatroid99

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2019

Is there any chance of this getting backported to node 10?

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