Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Issue 2526343003: Introduce new security restrictions in FetchEvent.respondWith(). (Closed)

Created:
4 years ago by horo
Modified:
4 years ago
Reviewers:
falken, haraken
CC:
chromium-reviews, michaeln, jsbell+serviceworker_chromium.org, kenjibaheux+watch_chromium.org, shimazu+serviceworker_chromium.org, serviceworker-reviews, jam, nhiroki, blink-reviews-api_chromium.org, dglazkov+blink, kinuko+serviceworker, asvitkine+watch_chromium.org, horo+watch_chromium.org, blink-reviews, darin-cc_chromium.org, kinuko+watch, tzik, falken+watch_chromium.org, blink-worker-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Introduce 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
Unified diffs Side-by-side diffs Delta from patch set Stats (+161 lines, -19 lines) Patch
M third_party/WebKit/LayoutTests/http/tests/serviceworker/redirected-response.html View 1 2 2 chunks +69 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/frame/Deprecation.cpp View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/UseCounter.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/DocumentLoader.cpp View 1 2 2 chunks +14 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/fetch/FetchManager.cpp View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.h View 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/serviceworkers/ForeignFetchRespondWithObserver.cpp View 1 3 chunks +5 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.h View 3 chunks +8 lines, -5 lines 1 comment Download
M third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.cpp View 1 2 7 chunks +43 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp View 1 2 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerResponseError.h View 1 chunk +2 lines, -1 line 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 45 (35 generated)
horo
falken@ Could you please review?
4 years ago (2016-12-12 07:49:39 UTC) #26
falken
looks good https://codereview.chromium.org/2526343003/diff/120001/third_party/WebKit/LayoutTests/http/tests/serviceworker/redirected-response.html File third_party/WebKit/LayoutTests/http/tests/serviceworker/redirected-response.html (right): https://codereview.chromium.org/2526343003/diff/120001/third_party/WebKit/LayoutTests/http/tests/serviceworker/redirected-response.html#newcode1 third_party/WebKit/LayoutTests/http/tests/serviceworker/redirected-response.html:1: <!DOCTYPE html> In CL description, part #2 ...
4 years ago (2016-12-12 08:40:18 UTC) #27
horo
Thank you. https://codereview.chromium.org/2526343003/diff/120001/third_party/WebKit/LayoutTests/http/tests/serviceworker/redirected-response.html File third_party/WebKit/LayoutTests/http/tests/serviceworker/redirected-response.html (right): https://codereview.chromium.org/2526343003/diff/120001/third_party/WebKit/LayoutTests/http/tests/serviceworker/redirected-response.html#newcode1 third_party/WebKit/LayoutTests/http/tests/serviceworker/redirected-response.html:1: <!DOCTYPE html> On 2016/12/12 08:40:17, falken wrote: ...
4 years ago (2016-12-12 09:31:07 UTC) #31
falken
sorry for the delay, slipped my attention this morning. lgtm. https://codereview.chromium.org/2526343003/diff/140001/third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.h File third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.h (right): https://codereview.chromium.org/2526343003/diff/140001/third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.h#newcode75 ...
4 years ago (2016-12-13 04:43:39 UTC) #34
horo
haraken@ Could you please review third_party/WebKit/Source/core/* and third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp?
4 years ago (2016-12-13 04:48:32 UTC) #36
horo
haraken@ Could you please review third_party/WebKit/Source/core/* and third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp?
4 years ago (2016-12-13 04:48:35 UTC) #37
haraken
LGTM
4 years ago (2016-12-13 05:13:27 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2526343003/140001
4 years ago (2016-12-13 05:16:13 UTC) #40
commit-bot: I haz the power
Committed patchset #3 (id:140001)
4 years ago (2016-12-13 05:22:09 UTC) #43
commit-bot: I haz the power
4 years ago (2016-12-13 05:28:55 UTC) #45
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/82298e59225ddfab0402b77c265624acb29632a4
Cr-Commit-Position: refs/heads/master@{#438063}

Powered by Google App Engine
This is Rietveld 408576698