Skip to content
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

Sec-Fetch-Site for service worker update request #36

Closed
makotoshimazu opened this issue Jul 3, 2019 · 3 comments
Closed

Sec-Fetch-Site for service worker update request #36

makotoshimazu opened this issue Jul 3, 2019 · 3 comments

Comments

@makotoshimazu
Copy link

Requests for service worker script's update may not have request's initiator as like user initiated navigation since it may not be triggered by sites.
I'm guessing 'none' is an appropriate value for the Sec-Fetch-Site header for that case.

@arturjanc
Copy link
Contributor

This is an interesting case. Is the service worker update request sent for the same URL from which the original SW is loaded? If so, I'd consider this to be a same-origin request because the origin which installs the SW controls the URL to which the update request is later made by the browser.

(I also have nothing against none if that seems to make more sense here.)

@makotoshimazu
Copy link
Author

Yeah, the URL of a request to update a service worker is the same with the origin of the original SW and also the same with the origin of the page which called navigator.serviceWorker.register("sw.js").
same-origin sounds reasonable too.

Btw, I also found that we need to set request's origin to the origin for the main script. IIUC, it will automatically fix this issue.
w3c/ServiceWorker#1447

@mikewest
Copy link
Member

mikewest commented Sep 3, 2019

I agree that same-origin is fine here, as service workers need to be same-origin, and the update request can reasonably be considered an extension of the origin's initial registration.

It sounds like this only requires a change in the Service Worker spec, which @makotoshimazu already filed. Closing this out in favor of that. :)

@mikewest mikewest closed this as completed Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants