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

Expose status of filtered opaque response? #14

Closed
jeffposnick opened this issue Nov 10, 2014 · 4 comments
Closed

Expose status of filtered opaque response? #14

jeffposnick opened this issue Nov 10, 2014 · 4 comments

Comments

@jeffposnick
Copy link

CC: @slightlyoff

The current specification for an opaque filtered response requires that the status always be set to 0. Could this be relaxed?

I understand that the restriction is in place to prevent leaking information that wouldn't otherwise be available for non-CORS requests/responses, but exposing either the actual HTTP response code or a boolean success/error would be very useful, and may not(*) leak more information that could already be inferred via the onerror/onload handlers for elements like <img> and <link>.

As it's currently implemented, when fetch()ing a non-CORS request from the context of a Service Worker, it's not possible to make an informed decisions about whether the filtered opaque response should be cached or not. Blindly caching a (possibly transient) error response isn't ideal, but the other extreme of not caching any filtered opaque responses runs counter to the utility of Service Workers.

(*It's entirely possible that I'm missing some important privacy implications.)

@slightlyoff
Copy link

Given that rough status is available this way, a status-code of 0 seems punitive to folks using fetch(). Can we revisit?

@jakearchibald
Copy link
Collaborator

We talked about this for failing cache.addAll on things like 404. It was decided that this is a security leak (since on things like Chrome Issues a 404 vs 200 can 'out' you as someone with permission to view non-public issues), and the fact that appcache can do it is a mistake. w3c/ServiceWorker#258 (comment)

@jeffposnick
Copy link
Author

Thanks for the context, @jakearchibald, and sorry to rehash something that had already been decided.

Making each developer weigh the tradeoffs of caching vs. non-caching filtered opaque responses is a bummer, but so it goes.

@jakearchibald
Copy link
Collaborator

If we can find a safe way to do it (or decide it's safe) then I'll add a failOnNon200 (or whatever) option to cache.addAll

@annevk annevk closed this as completed Nov 13, 2014
yutakahirano added a commit that referenced this issue Jun 23, 2020
# This is the 1st commit message:

# This is a combination of 23 commits.
# This is the 1st commit message:

Integrate CORP and COEP

This is part of the introduction of COEP
(whatwg/html#5454). The CORP check now takes
COEP into account. Also, responses coming from service workers
are checked.

# This is the commit message #2:

Update fetch.bs

Co-authored-by: Domenic Denicola <d@domenic.me>
# This is the commit message #3:

Update fetch.bs

Co-authored-by: Domenic Denicola <d@domenic.me>
# This is the commit message #4:

fix

# This is the commit message #5:

fix

# This is the commit message #6:

fix

# This is the commit message #7:

fix

# This is the commit message #8:

fix

# This is the commit message #9:

fix

# This is the commit message #10:

fix

# This is the commit message #11:

fix

# This is the commit message #12:

fix

# This is the commit message #13:

fix

# This is the commit message #14:

fix

# This is the commit message #15:

fix

# This is the commit message #16:

fix

# This is the commit message #17:

fix

# This is the commit message #18:

Update fetch.bs

Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
# This is the commit message #19:

Update fetch.bs

Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
# This is the commit message #20:

fix

# This is the commit message #21:

fix

# This is the commit message #22:

fix

# This is the commit message #23:

fix

# This is the commit message #2:

fix
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

4 participants