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

Is respondWith(fetch(event.request)) always the same as not calling respondWith()? #1395

Open
mfalken opened this issue Mar 19, 2019 · 6 comments

Comments

@mfalken
Copy link
Member

mfalken commented Mar 19, 2019

At the Loading Signed Exchanges spec, the service worker interaction is defined such that respondWith(fetch(event.request)) produces different behavior than not calling respondWith().

I'm know we've historically tried to keep this the same. Are there any other known cases where these differ?

I've also filed WICG/webpackage#409 for the specific issue of SXG and service worker interaction.

@annevk
Copy link
Member

annevk commented Mar 19, 2019

I'm pretty sure, e.g., request's destination is reset for one and not the other. And we don't do say CSP checks with the service worker's CSP when you don't call respondWith().

(Note that some of this does need to happen with routing.)

@asakusuma
Copy link

It would be really nice if they were the same, or if there was another way to "bail out" of responding once you've already passed a promise into respondWith.

@annevk
Copy link
Member

annevk commented Apr 3, 2019

@jakearchibald should we reconsider this yet again? I know we went over it a bunch of times in the past, but perhaps exposing something like defaultfetch() in service workers for this purpose makes sense?

@jakearchibald
Copy link
Contributor

I'm half way through going through the signed exchange spec & plan to understand it by the end of the week. I'd still like to avoid defaultFetch() if we can.

TODO for me: list all the ways respondWith(fetch(event.request)) is different to no respondWith. Off the top of my head there's MIX, but I'm sure there's more.

@annevk
Copy link
Member

annevk commented Apr 4, 2019

CSP of the service worker will not apply, Sec-Fetch-* if added won't be changed, etc.

@mfalken
Copy link
Member Author

mfalken commented Apr 5, 2019

I misread the Loading Signed Exchange spec and respondWith(fetch(event.request)) is expected to be the same as not calling respondWith(). What made me wary was WICG/webpackage#347 (comment) and being told the spec would have to change to keep the equivalence.

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

4 participants