Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 36.4k
dns: idna encode hostnames before resolution#25559
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -22,6 +22,8 @@ | ||
| 'use strict'; | ||
| const cares = internalBinding('cares_wrap'); | ||
| const { toASCII } = internalBinding('config').hasIntl ? | ||
| internalBinding('icu') : require('punycode'); | ||
| const { isIP, isIPv4, isLegalPort } = require('internal/net'); | ||
| const { customPromisifyArgs } = require('internal/util'); | ||
| const errors = require('internal/errors'); | ||
| @@ -213,6 +215,11 @@ function resolver(bindingName) { | ||
| throw new ERR_INVALID_CALLBACK(); | ||
| } | ||
| try { | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would this be needed if we were only using the ICU based MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My guess is no | ||
| name = toASCII(name, true); | ||
| } catch { | ||
| // If using the punycode implementation, be lenient too | ||
| } | ||
| var req = new QueryReqWrap(); | ||
| req.bindingName = bindingName; | ||
| req.callback = callback; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -39,7 +39,8 @@ const addresses = { | ||
| // An accessible IPv4 DNS server | ||
| DNS4_SERVER: '8.8.8.8', | ||
| // An accessible IPv4 DNS server | ||
| DNS6_SERVER: '2001:4860:4860::8888' | ||
| DNS6_SERVER: '2001:4860:4860::8888', | ||
| IDNA_HOST: 'españa.icom.museum' | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 also, I'd say a comment is missing. | ||
| }; | ||
| for (const key of Object.keys(addresses)) { | ||
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.
What's the policy here, considering
punycodeis deprecated?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 don't know 🤷♂️
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.
FWIW, we do the same thing in
lib/url.js, so it's probably fine.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.
Using punycode is the fallback if Node.js is compiled without ICU.
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 think it's only deprecated for userland.