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

CORS preflights need a service-workers mode of "none" #598

Merged
merged 1 commit into from
Sep 20, 2017

Conversation

annevk
Copy link
Member

@annevk annevk commented Sep 5, 2017

Fixes #558.

This probably does not matter as it's never going to be same-origin, but better safe than sorry.


Preview | Diff

@annevk
Copy link
Member Author

annevk commented Sep 19, 2017

It does actually matter I just realized. You can go cross-origin and then same-origin via a redirect.

@jakearchibald
Copy link
Collaborator

I don't think this is technically needed because CORS-preflight fetch calls HTTP-network-or-cache fetch, whereas the service worker interception happens in HTTP fetch.

Redirects aren't an issue, because HTTP-network-or-cache fetch doesn't follow redirects. Well, it's an issue if CORS preflights are expected to follow redirects. Are they?

Setting this for safety seems fine, but maybe include a note to say it doesn't do anything right now?

@annevk
Copy link
Member Author

annevk commented Sep 19, 2017

No, a CORS preflight itself doesn't follow redirects. But the actual request following it will (resulting in another CORS preflight for the new URL).

So given that, I think it would be better to point out your finding in a note than add this. That makes it much more clear what's going on.

@annevk annevk force-pushed the annevk/preflight-service-workers-mode branch from a0784d8 to 10a20a7 Compare September 20, 2017 07:37
@annevk annevk force-pushed the annevk/preflight-service-workers-mode branch from 10a20a7 to 7830c74 Compare September 20, 2017 07:38
@annevk
Copy link
Member Author

annevk commented Sep 20, 2017

Okay, should be good now.

Copy link
Collaborator

@jakearchibald jakearchibald left a comment

Choose a reason for hiding this comment

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

lgtm!

@annevk annevk merged commit 487d1a9 into master Sep 20, 2017
@annevk annevk deleted the annevk/preflight-service-workers-mode branch September 20, 2017 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants