Skip to content
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

Merged
merged 2 commits into from Feb 24, 2021
Merged

[URL] Add tests for the distinct percent-encode sets #27742

merged 2 commits into from Feb 24, 2021

Conversation

alwinb
Copy link
Contributor

@alwinb alwinb commented Feb 23, 2021

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.

Copy link
Member

@domenic domenic left a 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.

"host": "host",
"hostname": "host",
"href": "wss://%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/",
"origin": "null",
Copy link
Member

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

"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",
Copy link
Member

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

@annevk
Copy link
Member

annevk commented Feb 23, 2021

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.

@alwinb
Copy link
Contributor Author

alwinb commented Feb 23, 2021

No you're right, the origin should be wss://host in those cases. I checked locally in the browser (via wpt serve) and did not spot this. This is why extra eyes are a good thing!

Copy link
Member

@domenic domenic left a 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 annevk merged commit 33f2e3f into web-platform-tests:master Feb 24, 2021
@alwinb
Copy link
Contributor Author

alwinb commented Mar 2, 2021

@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...

@annevk
Copy link
Member

annevk commented Mar 2, 2021

Thanks for the update, I think that's fine in this case.

@alwinb alwinb deleted the url-encode-sets branch April 10, 2021 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants