-
Notifications
You must be signed in to change notification settings - Fork 139
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
Do not remove newline and tab characters #419
Comments
Safari also follows the spec here. |
You could still construct a URL with However, browsers being divergent here does is sufficient to reconsider how the API should behave. We'd need somewhat exhaustive tests for all members (not just |
Yes, there is probably a way to fix the Node issue without waiting for this issue to be resolved. Using |
+1 on going with the temporary workaround for now, but I think it makes sense to follow the browser's behavior on this, at least in the setters. It is interesting to note that Chrome (I haven't checked the others) behaves per-spec with regards to the initial constructor...
Which is just a tad frustrating in it's inconsistency ;-) |
@annevk do you think it would be realistic to get browsers to adopt the spec by opening up bugs for this? Wondering if we can get any feedback from browser vendors here on these cases to know their constraints. |
Given that most browsers are not in line with the standard (at least that's what OP suggests, but exhaustive tests are needed as per my above comment) I think this can change. @achristensen07 can comment on behalf of Safari, but I suspect they'd want to align with the others on this. |
I oppose changing the spec here. Our setters use the same parsers as the constructor, and for elegance and performance reasons I would like to keep it that way. I also believe the reason why we have the tab-and-newline-removing logic in the constructor applies to setters as well. I have seen no internal bug reports indicating real compatibility problems from this. I would appreciate if Chrome, Firefox, and Edge aligned with the specification, Node, and Safari. |
Speaking for Firefox, I think we ought to align with the spec, as it really does make sense. |
What is the reason behind the removal of those characters? I would like URLs to have those two properties:
Having those two properties would imply that the constructor should be changed to no longer remove these characters. (Instead of removing the characters even in the setters) |
@demurgos I think you have to percent-encode system paths either way as the encoding is not always clear. They cannot be passed directly to a URL constructor. |
@achristensen07 I wrote tests for this in web-platform-tests/wpt#23265 of which Safari fails quite a few (some related to stripping, some related to other bugs). Looking at |
…tters, a=testonly Automatic update from web-platform-tests URL: stripping of tab and newlines in setters Closes whatwg/url#419. -- wpt-commits: 04aec1fa1b1f5cf8833b61682da707b7fd47bef6 wpt-pr: 23265
…tters, a=testonly Automatic update from web-platform-tests URL: stripping of tab and newlines in setters Closes whatwg/url#419. -- wpt-commits: 04aec1fa1b1f5cf8833b61682da707b7fd47bef6 wpt-pr: 23265
…tters, a=testonly Automatic update from web-platform-tests URL: stripping of tab and newlines in setters Closes whatwg/url#419. -- wpt-commits: 04aec1fa1b1f5cf8833b61682da707b7fd47bef6 wpt-pr: 23265 UltraBlame original commit: 4f721ebd4db736cb0f87059675e217194088b753
…tters, a=testonly Automatic update from web-platform-tests URL: stripping of tab and newlines in setters Closes whatwg/url#419. -- wpt-commits: 04aec1fa1b1f5cf8833b61682da707b7fd47bef6 wpt-pr: 23265 UltraBlame original commit: 4f721ebd4db736cb0f87059675e217194088b753
…tters, a=testonly Automatic update from web-platform-tests URL: stripping of tab and newlines in setters Closes whatwg/url#419. -- wpt-commits: 04aec1fa1b1f5cf8833b61682da707b7fd47bef6 wpt-pr: 23265 UltraBlame original commit: 4f721ebd4db736cb0f87059675e217194088b753
The current spec requires to produce a validation error if a newline or tab is encountered, and remove them from the input:
url/url.bs
Lines 1472 to 1474 in 49060c7
This contradicts the behavior observed in Firefox, Chrome and Edge:
"http://www.example.com/foobar"
"http://www.example.com/foo%0Abar"
"http://www.example.com/foobar"
"http://www.example.com/foo%09bar"
This issue was originally reported for Node: nodejs/node#23696
Removing these characters prevents the use of
file://
urls to represent files with newlines and tabs in their path.The text was updated successfully, but these errors were encountered: