script: Use correct creation_url for workers#56921
Merged
servo-wpt-sync merged 1 commit intoweb-platform-tests:masterfrom Dec 29, 2025
Merged
script: Use correct creation_url for workers#56921servo-wpt-sync merged 1 commit intoweb-platform-tests:masterfrom
servo-wpt-sync merged 1 commit intoweb-platform-tests:masterfrom
Conversation
wpt-pr-bot
approved these changes
Dec 24, 2025
Collaborator
wpt-pr-bot
left a comment
There was a problem hiding this comment.
The review process for this patch is being conducted in the Servo project.
4 tasks
5b05afa to
f2ff4ea
Compare
TimvdLippe
added a commit
to TimvdLippe/webappsec-referrer-policy
that referenced
this pull request
Dec 25, 2025
Based on an investigation as to why Servo doesn't use the correct URL per the spec [1] I thought that HTML was incorrectly setting the creation URL [2]. However, after writing a WPT test [3] it turns out that the creation URL is correctly set in HTML, but incorrectly used in Referrer Policy. Browsers don't use the creation URL to determine the referrer policy, per another WPT test [4]. Instead of the creation URL, browsers use the url of the worker, which is the same as the API base URL [5]. [1]: servo/servo#41458 [2]: whatwg/html#12038 [3]: web-platform-tests/wpt#56921 [4]: https://wpt.fyi/results/fetch/api/basic/request-referrer-redirected-worker.html?label=master&label=experimental&aligned [5]: https://html.spec.whatwg.org/multipage/workers.html#script-settings-for-workers:api-base-url
f2ff4ea to
493cd3c
Compare
Instead of the creation URL of the containing global, it should instead use the URL of the current worker. Despite the referrer specification stating that we should use the creation URL, instead browsers use the current URL. A new WPT test is added to cover that which we currently fail because of incorrect serialization of query parameters of a URL. But the actual redirect and all work now. Signed-off-by: Tim van der Lippe <[email protected]>
493cd3c to
d019528
Compare
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
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.
Instead of the creation URL of the containing global,
it should instead use the URL of the current worker.
Despite the referrer specification stating that we
should use the creation URL, instead browsers use
the current URL. A new WPT test is added to cover that
which we currently fail because of incorrect
serialization of query parameters of a URL. But the
actual redirect and all work now.
Reviewed in servo/servo#41458