-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
WHATWG URL API: base ignored if relative path starts with a double slash #30776
Comments
Per the URL standard, this appears to be working as expected. That is, the actual result above is correct and you should see similar/identical results both in Chrome and Firefox. |
I see, the protocol can be relative, and the documentation does state that the base is used if the URL is not absolute. Then again, this is a bit of a edge case: I cannot have relative URLs starting with a double-slash with the WHATWG URL API (as dubious as that might be), even though this makes for a perfectly valid relative URL. |
It may be worth opening an issue in the url standard repo |
Yeah, sorry for that issue, I didn't know about the relative protocol thing. 😑 Thanks for looking into this. 👍 |
# Description Fix a bug where an URL containing both a trailing slash and a querystring would be incorrectly parsed. # How to reproduce The following HTTP GET request works fine: `http://localhost:7512/_now?pretty` But not this one without this PR: `http://localhost:7512/_now/?pretty` Both requests are equivalent and should be regarded as identical. # Other changes ~Use the WHATWG URL parsing API instead of the legacy (and deprecated) Node.js URL parser. Unfortunately, the latter was much more adapted to URL parsing server-side than the former. 😑~ Reverted to the legacy URL API because of: * nodejs/node#30334 (huge performance hit with WHATWG) * nodejs/node#30776 (bug with relative URLs starting with double-slashes)
Instantiating a new WHATWG URL with a base option, and a relative URL starting with a double slash ends up with the base option being ignored.
How to reproduce
Expected result
Actual result
The text was updated successfully, but these errors were encountered: