You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IDNA2008 DISALLOWED characters are permitted in URL #41977
Linux deskt 5.13.0-28-generic #31~20.04.1-Ubuntu SMP Wed Jan 19 14:08:10 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
Take any character disallowed in domain names in the list from the internet standard (RFC) here and insert it in a URL (e.g. \u0556):
$ node -i
> new URL('http://\u0556.com');
How often does it reproduce? Is there a required condition?
All the time.
What is the expected behavior?
Uncaught TypeError [ERR_INVALID_URL]: Invalid URL
at __node_internal_captureLargerStackTrace (node:internal/errors)
at new NodeError (node:internal/errors)
at onParseError (node:internal/url)
at new URL (node:internal/url) {
input: 'http://\u0556.com/',
code: 'ERR_INVALID_URL'
}
Node.js follows the WHATWG URL spec, which does not forbids those characters it seems: https://url.spec.whatwg.org/#host-miscellaneous. This behavior is consistent with Firefox, Chromium, Safari, and Deno.
Activity
aduh95 commentedon Feb 14, 2022
Node.js follows the WHATWG
URLspec, which does not forbids those characters it seems: https://url.spec.whatwg.org/#host-miscellaneous. This behavior is consistent with Firefox, Chromium, Safari, and Deno.If you think this API should restrict the allowed characters, please open an issue on their repo: https://github.com/whatwg/url.
I'm going to close this now, but if you think I missed something don't hesitate to re-open or to ask more questions.