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

Dispatch to foreign fetch for redirects #362

Closed
annevk opened this issue Aug 10, 2016 · 3 comments
Closed

Dispatch to foreign fetch for redirects #362

annevk opened this issue Aug 10, 2016 · 3 comments
Assignees

Comments

@annevk
Copy link
Member

annevk commented Aug 10, 2016

Currently we set the skip-service-worker flag so a new location of a redirect does not get intercepted by a same-origin service worker. However, a cross-origin service worker should likely intercept that, otherwise we make service migration harder.

See w3c/ServiceWorker#793 for context.

@mkruisselbrink will fix this (and will soon be able to assign himself).

annevk added a commit that referenced this issue Aug 10, 2016
This commit makes the following changes:

* Moves 401 and 407 handling into the network realm. That way 401 and
407 responses from service worker just surface at the API level rather
than potentially triggering new network activity.
* That means only responses with redirect statuses have special
semantics when they come from a service worker.
* Only when redirects are automatically followed should we set the
skip-service-worker flag, otherwise we negatively affect navigations.
(Note #362 for follow up work regarding foreign fetch, which is still
somewhat broken.)
* This also removes the requirement that a 407 abides by the CORS
protocol, which was not entirely sensical.
* It makes various editorial corrections, for which I apologize as in
retrospect they make this harder to review.

Fixes #363 and fixes
w3c/ServiceWorker#793.
@annevk
Copy link
Member Author

annevk commented Aug 10, 2016

This should be quite a bit easier now thanks to #363.

@mkruisselbrink mkruisselbrink self-assigned this Aug 10, 2016
@sirdarckcat
Copy link

Just to clarify. Would this mean that a 30X redirect on any subresource HTTP request would trigger the service worker of the target URL and dispatch a foreign fetch event?

@annevk
Copy link
Member Author

annevk commented Oct 17, 2016

No, only requests that are cross-origin, but same-origin with a foreign-fetch service worker. Same-origin we cannot expose without some kind of server-side opt-in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants