Skip to content

Service Worker update requests have a malformed referer (referer: https:) #47240

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

Conversation

youennf
Copy link
Contributor

@youennf youennf commented Jun 26, 2025

7a0a88a

Service Worker update requests have a malformed referer (referer: https:)
rdar://154364616
https://bugs.webkit.org/show_bug.cgi?id=294715

Reviewed by Brady Eidson.

SWServer::createScriptRequest is using URL to create a valid referer but this does not give the expected result.
Instead reuse an existing routine to generate a referrer from an URL.

* LayoutTests/http/wpt/service-workers/resources/soft-update-service-worker.py: Added.
(main):
* LayoutTests/http/wpt/service-workers/soft-update-referrer-expected.txt: Added.
* LayoutTests/http/wpt/service-workers/soft-update-referrer.html: Added.
* Source/WebCore/workers/service/server/SWServer.cpp:
(WebCore::SWServer::createScriptRequest):
(WebCore::originURL): Deleted.
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:

Canonical link: https://commits.webkit.org/296710@main

f20d662

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ⏳ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@youennf youennf requested a review from cdumez as a code owner June 26, 2025 15:06
@youennf youennf self-assigned this Jun 26, 2025
@youennf youennf added the Service Workers Component for Service Workers bugs. label Jun 26, 2025
@youennf youennf added the merge-queue Applied to send a pull request to merge-queue label Jun 27, 2025
…ps:)

rdar://154364616
https://bugs.webkit.org/show_bug.cgi?id=294715

Reviewed by Brady Eidson.

SWServer::createScriptRequest is using URL to create a valid referer but this does not give the expected result.
Instead reuse an existing routine to generate a referrer from an URL.

* LayoutTests/http/wpt/service-workers/resources/soft-update-service-worker.py: Added.
(main):
* LayoutTests/http/wpt/service-workers/soft-update-referrer-expected.txt: Added.
* LayoutTests/http/wpt/service-workers/soft-update-referrer.html: Added.
* Source/WebCore/workers/service/server/SWServer.cpp:
(WebCore::SWServer::createScriptRequest):
(WebCore::originURL): Deleted.
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:

Canonical link: https://commits.webkit.org/296710@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Service-Worker-update-requests-have-a-malformed-referer-referer-https branch from f20d662 to 7a0a88a Compare June 27, 2025 06:49
@webkit-commit-queue
Copy link
Collaborator

Committed 296710@main (7a0a88a): https://commits.webkit.org/296710@main

Reviewed commits have been landed. Closing PR #47240 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 7a0a88a into WebKit:main Jun 27, 2025
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Service Workers Component for Service Workers bugs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants