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

Enforce UTF-8 when url is given to the basic URL parser #783

Open
annevk opened this issue Sep 3, 2023 · 1 comment
Open

Enforce UTF-8 when url is given to the basic URL parser #783

annevk opened this issue Sep 3, 2023 · 1 comment

Comments

@annevk
Copy link
Member

annevk commented Sep 3, 2023

HTML stopped using the encoding argument under these conditions as of whatwg/html#8309 as far as I can tell. Making that clear in the specification would benefit implementers.

@annevk
Copy link
Member Author

annevk commented Nov 29, 2024

Here's a somewhat ambitious idea:

  • We rename basic URL parser to internal URL parser and mandate all of its arguments. We stop exporting it.
  • We create a new API URL parser that is essentially the internal URL parser except it does not have an encoding argument. This one is exported. (The existing internal API URL parser would have to be renamed or maybe this should have a slightly different name.) This would require a whatwg/html PR.
  • We modify the URL parser entry point so that it is suitable for all implementations, perhaps by making the blob: URL and encoding requirements conditional upon the user agent being a browser.

A less ambitious approach would be to add some asserts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant