-
Notifications
You must be signed in to change notification settings - Fork 139
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
Verify domain is not empty after "domain to ASCII" #497
Conversation
The empty host is not allowed in special non-"file" URLs, but `domain to ASCII` result can be the empty string, even if the input is not empty, for example: * the input consists entirely of IDNA ignored code points; * the input is `xn--`. The `domain to ASCII` do not fail when it is called from `host parser`, because `VerifyDnsLength` is false. So we need additional check after it.
See whatwg/url#497 for context.
See also #438. I think we should add this check in https://url.spec.whatwg.org/#concept-domain-to-ascii so that a domain also cannot be valid if it ends up empty. |
Hmm, in the valid domain check https://whatpr.org/url/497.html#valid-domain the |
Ah fair, I guess I'd still like to include this check there, but I'd be okay with making it conditional upon beStrict. At some point we have to revise the general ToASCII operation and it would be good if all the weirdness was consolidated to make that easier. |
OK, changed. |
See whatwg/url#497 for context.
…st, a=testonly Automatic update from web-platform-tests URL: test IDNA ignored code points in host See whatwg/url#497 for context. -- wpt-commits: e9a106175a02a192a7239f42a94235fbe0f0c7a3 wpt-pr: 23432
…st, a=testonly Automatic update from web-platform-tests URL: test IDNA ignored code points in host See whatwg/url#497 for context. -- wpt-commits: e9a106175a02a192a7239f42a94235fbe0f0c7a3 wpt-pr: 23432
…st, a=testonly Automatic update from web-platform-tests URL: test IDNA ignored code points in host See whatwg/url#497 for context. -- wpt-commits: e9a106175a02a192a7239f42a94235fbe0f0c7a3 wpt-pr: 23432
…st, a=testonly Automatic update from web-platform-tests URL: test IDNA ignored code points in host See whatwg/url#497 for context. -- wpt-commits: e9a106175a02a192a7239f42a94235fbe0f0c7a3 wpt-pr: 23432
Per the change in whatwg/url#497.
Port of whatwg/url#497 PR-URL: #33770 Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Port of whatwg/url#497 PR-URL: nodejs#33770 Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
The empty host is not allowed in special non-"file" URLs, but
domain to ASCII
result can be the empty string, even if theinput is not empty, for example:
xn--
.The
domain to ASCII
do not fail when it is called fromhost parser
,because
VerifyDnsLength
is false.So we need additional check after it.
An interesting case is with file URLS, as empty host is allowed. But most
browsers report failure as well. I tested URLs with the
U+00AD
percent encoded in host:
file://%C2%AD/p
file:///p
http://%C2%AD/p
Note. To find more IDNA ignored code points refer to IDNA Mapping Table:
https://unicode.org/reports/tr46/#IDNA_Mapping_Table
(See WHATWG Working Mode: Changes for more details.)
Preview | Diff