Skip to content

script: Use correct creation_url for workers#56921

Merged
servo-wpt-sync merged 1 commit intoweb-platform-tests:masterfrom
servo:servo_export_41458
Dec 29, 2025
Merged

script: Use correct creation_url for workers#56921
servo-wpt-sync merged 1 commit intoweb-platform-tests:masterfrom
servo:servo_export_41458

Conversation

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

@servo-wpt-sync servo-wpt-sync commented Dec 24, 2025

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

Copy link
Copy Markdown
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Servo project.

@servo-wpt-sync servo-wpt-sync changed the title script: Use creation URL for referrer script: Use correct creation_url for workers Dec 24, 2025
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
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]>
@servo-wpt-sync servo-wpt-sync merged commit a94b364 into web-platform-tests:master Dec 29, 2025
25 checks passed
@servo-wpt-sync servo-wpt-sync deleted the servo_export_41458 branch December 29, 2025 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants