- From: Anne van Kesteren <notifications@github.com>
- Date: Tue, 14 Apr 2015 02:11:42 -0700
- To: whatwg/fetch <fetch@noreply.github.com>
Received on Tuesday, 14 April 2015 09:12:09 UTC
What I'd like to do is that if we're certain that e.g. `Accept` is always set based on a request context, we specify that logic as part of Fetch. That way it is clear when `Accept` is set, whether service workers can observe it, and what kind of values it can have. (That would mean that `<img>` no longer needs to talk about `Accept` but can depend on the request context.) And then go through that for each desired feature so that it's clear what the realm of a request context (e.g. "image") is and what's in the realm of a feature (e.g. `<img>`). In the case of `fetch(url, {as: "image"})` we'd need to restrict the `Response` so that it can only be used by `<img>` and `background-image` (otherwise CSP is broken). At this point, that would only make such an API useful in service workers (and even that is a bit of a stretch as service workers have their own CSP policy), but perhaps in the future `<img>` et al can be fed a `Response` directly. --- Reply to this email directly or view it on GitHub: https://github.com/whatwg/fetch/issues/43#issuecomment-92710035
Received on Tuesday, 14 April 2015 09:12:09 UTC