-
Notifications
You must be signed in to change notification settings - Fork 3.6k
URL: trailing spaces always get removed from opaque paths #51129
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 tasks
karwa
reviewed
Mar 6, 2025
26a58e8 to
ffd1def
Compare
rmisev
suggested changes
Mar 12, 2025
Member
rmisev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but two comments need to be corrected.
rmisev
reviewed
Mar 12, 2025
valenting
approved these changes
Mar 13, 2025
rmisev
approved these changes
Mar 13, 2025
eb2157a to
2bcbcdf
Compare
annevk
added a commit
to whatwg/url
that referenced
this pull request
Mar 14, 2025
In fdaa0e5 we tackled a problem whereby removing the fragment or query from a URL with an opaque path through the API would not make the URL roundtrip due to the opaque path being able to end in non-percent-encoded spaces. However, this failed to address other ways of serializing the URL. As such this is a new approach whereby opaque paths simply cannot end with non-percent-encoded spaces. Enforcing this in the URL parser allows us to completely revert the aforementioned commit, greatly simplifying the API implementation. Tests: web-platform-tests/wpt#51129. Fixes #784. Supersedes and closes #785.
webkit-commit-queue
pushed a commit
to annevk/WebKit
that referenced
this pull request
Mar 14, 2025
https://bugs.webkit.org/show_bug.cgi?id=289160 rdar://146848690 Reviewed by Alex Christensen. Instead of attempting to account for opaque paths sometimes ending in spaces in the API implementation and failing because that did not account for serialization, this new approach always percent-encodes the final space of the path. This is thought to be the least invasive change that is hopefully web-compatible. This is standardized here: whatwg/url#844 Test changes are upstreamed here: web-platform-tests/wpt#51129 * LayoutTests/fast/events/popup-blocked-from-unique-frame-via-window-open-named-sibling-frame-expected.txt: * LayoutTests/http/tests/security/no-popup-from-sandbox-top-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/a-element-origin-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/a-element-origin-xhtml-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/a-element-xhtml_exclude=(file_javascript_mailto)-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/a-element_exclude=(file_javascript_mailto)-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/resources/setters_tests.json: * LayoutTests/imported/w3c/web-platform-tests/url/resources/urltestdata.json: * LayoutTests/imported/w3c/web-platform-tests/url/url-constructor.any.worker_exclude=(file_javascript_mailto)-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/url-constructor.any_exclude=(file_javascript_mailto)-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/url-origin.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/url-origin.any.worker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/url-setters-a-area.window-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/url-setters.any.worker_exclude=(file_javascript_mailto)-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/url-setters.any_exclude=(file_javascript_mailto)-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/urlsearchparams-delete.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/urlsearchparams-delete.any.js: (test): * LayoutTests/imported/w3c/web-platform-tests/url/urlsearchparams-delete.any.worker-expected.txt: * Source/WTF/wtf/URL.cpp: (WTF::URL::removeFragmentIdentifier): (WTF::URL::removeQueryAndFragmentIdentifier): (WTF::URL::setQuery): (WTF::URL::maybeTrimTrailingSpacesFromOpaquePath): Deleted. * Source/WTF/wtf/URL.h: * Source/WTF/wtf/URLParser.cpp: (WTF::URLParser::parse): Canonical link: https://commits.webkit.org/292146@main
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For whatwg/url#844.