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
[URL] Add tests for the distinct percent-encode sets #27742
Conversation
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.
Found a couple mismatches between this and jsdom/whatwg-url. Whether it's the tests that are wrong, or jsdom/whatwg-url, is unclear... let me know what you think.
url/resources/urltestdata.json
Outdated
"host": "host", | ||
"hostname": "host", | ||
"href": "wss://%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/", | ||
"origin": "null", |
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.
jsdom/whatwg-url says this should be wss://host
url/resources/urltestdata.json
Outdated
"host": "host", | ||
"hostname": "host", | ||
"href": "wss://joe:%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/", | ||
"origin": "null", |
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.
jsdom/whatwg-url says this should be wss://host
They have an origin per https://url.spec.whatwg.org/#origin. Thanks for working on this @alwinb! Are you also planning to file browser bugs? I suspect some of these might be tracked already, but it might help to have a fresh one with all the relevant data in it. |
No you're right, the origin should be |
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.
LGTM, all tests pass with jsdom/whatwg-url.
@annevk I am a bit uneasy about filing browser bugs. I wonder if more will come up while I study this, and there are some issues that look like they will trigger additional small changes to the encode sets. I kind of prefer to send a single bug report to them rather than several with changes in a row. Maybe that's being too careful, but still... |
Thanks for the update, I think that's fine in this case. |
This adds a number of test cases to test the distinct percent-encode sets as specified in the Percent-encoded bytes section of the WHATWG URL Standard.