-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Idna v2 #250
Conversation
You need to percent-encode the input (I pushed a change for this to my web-platform-tests PR). That will reduce errors due to |
Now most (all?) of the failures seem to come from empty labels, e.g. |
It's not prohibited, but UTS46 runs https://www.rfc-editor.org/rfc/rfc5893#section-2 on each label and the first subrule there assumes the label to be non-empty. From @TimothyGu's comment it sounds like the JS Punycode library runs into that. |
So is the intent of merging web-platform-tests/wpt#38080 to make it a de-facto requirement to prohibit such empty labels, i.e., any implementation which wants to pass the WPT suite must add some prohibition on them? Here's our implementation, FWIW: https://github.com/jsdom/tr46/blob/13d02e630ad6da5ab974f4adfc7c4afb6b44c619/index.js#L132 |
No, |
Hmm OK. So do we have feedback lined up for this "fundamental bug"? And, are we just saying that the correct fix for that bug, is to allow such empty labels? |
See the second item in whatwg/url#744. Because we don't pass VerifyDnsLength browsers allow empty labels. It might be worth revisiting that, but that's the status quo. E.g., |
As discovered in jsdom/whatwg-url#250, the library currently does not handle empty labels in the same way that browsers seem to do. Although the standard is unclear, we should align to browser handling. To test this, we pull in the new IdnaTestV2.json file from WPT. This is somewhat redundant with our existing IdnaTestV2.txt, but it also represents a significant curation effort to ensure we only have URL-applicable tests, so we should make use of that.
After jsdom/tr46#39, there is one remaining failure case. I believe it is caused by mathiasbynens/punycode.js#129. |
As discovered in jsdom/whatwg-url#250, the library currently does not handle empty labels in the same way that browsers seem to do. Although the standard is unclear, we should align to browser handling. To test this, we pull in the new IdnaTestV2.json file from WPT. This is somewhat redundant with our existing IdnaTestV2.txt, but it also represents a significant curation effort to ensure we only have URL-applicable tests, so we should make use of that.
This does not currently work; /cc @annevk @karwa to see the failures. I suspect they're more bugs in the tr46 or punycode JS modules, but it's hard to be sure... tr46 is supposedly passing all the IdnaTestV2.txt tests, but maybe check out our test harness at https://github.com/jsdom/tr46/blob/master/test/unicode.js to see if something's going wrong in either of the two test harnesses?