Chromium Code Reviews
DescriptionIntroduce new security restrictions in FetchEvent.respondWith().
This CL introduces two changes in the restriction of FetchEvent.respondWith().
1. Allow responding to non-navigation requests which redirect mode is 'manual'
with opaque-redirect responses.
Ex:
SW: self.onfetch = evt => { evt.respondWith(fetch(evt.request)); };
Page: fetch(new Request("/redirect-url", {redirect: 'manual'}));
Server: Returns a redirect response to somewhere.
Before this CL: fetch() fails.
After this CL: fetch() returns the opaque-redirect response.
2. Add a deprecation warning for responding to requests which redirect mode is
not 'follow' with redirected responses. Not to suddenly break existing sites
we allow responding to navigation requests with redirected responses and show
two warning messages. One in the DevTools attached to the service worker from
RespondWithObserver::responseWasFulfilled(). And one in the DevTools attached
to the page tab from DocumentLoader::finishedLoading().
BUG=658249
Committed: https://crrev.com/82298e59225ddfab0402b77c265624acb29632a4
Cr-Commit-Position: refs/heads/master@{#438063}
Patch Set 1 #Patch Set 2 : rebase #
Total comments: 16
Patch Set 3 : incorporated falken's comment #
Total comments: 1
Messages
Total messages: 45 (35 generated)
|