-
Notifications
You must be signed in to change notification settings - Fork 140
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
Removing trailing C0 control or space at basic URL parser makes difference with override #542
Comments
Why should it show the same result? They're not the same API. |
It always requires the override state when users want to put |
That might be reasonable, but should be an opt-in constructor argument of sorts I think. E.g., |
Right. The optional constructor argument design would be better for backward compatibility. I just updated the description of this PR to address the discussion. |
FWIW I would prefer to always remove, in both APIs. It would be nice if the URL data model could guarantee no trailing C0 control or space instead of having the trimming being a parsing quirk. |
The data model already guarantees it, no? It ends up ending with %00, not U+0000. Which is also why it seems reasonable to allow the parser to do that transformation for you if you want it. I doubt we can change the API generally and given that the API is for individual components it's already a very different proposition. Why should |
Compared to other API requests we got this hasn't gotten a lot of interest so I'm inclined to close this until we see more of a demand in libraries. |
Steps to reproduce
The below
console.log
should show the same result. Otherwise: #542 (comment)Summary
Because the basic URL parser removes trailing c0 control or space only when
url
is not given, it makes a difference with override.Refs: https://url.spec.whatwg.org/#url-parsing
Potential solutions would be below two:
new URL(..., { noTrim: true })
. Refs: Removing trailing C0 control or space at basic URL parser makes difference with override #542 (comment)The text was updated successfully, but these errors were encountered: