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

Issue 1665533003: Set the request mode and the credentials mode of FetchEvent in the service worker correctly. (Closed)

Created:
4 years, 10 months ago by horo
Modified:
4 years, 10 months ago
CC:
blink-reviews, chromium-reviews, falken, gavinp+loader_chromium.org, horo+watch_chromium.org, Nate Chapin, jsbell+serviceworker_chromium.org, kenjibaheux+watch_chromium.org, kinuko+serviceworker, kinuko+watch, loading-reviews_chromium.org, michaeln, nhiroki, serviceworker-reviews, tyoshino+watch_chromium.org, tzik
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Set the request mode and the credentials mode of FetchEvent in the service worker correctly. Currently the request mode and the credentials mode of FetchEvent.request are not correctly set. 1. The credentials mode of no-cors resource request must be 'include', but currently 'same-origin'. (https://crbug.com/576534) ex: <img src="img.png"> <script src="test.js"> 2. When fetch() is called in the page, the FetchEvent.request.mode is always 'cors' and the FetchEvent.request.credentials is always 'same-origin' in the service worker. (https://crbug.com/543895) 3. When an audio element fetches a request, the FetchEvent.request.mode is always 'cors' and the FetchEvent.request.credentials is always 'same-origin' in the service worker. Expected: - <audio> mode: no-cors, credentials: include - <audio crossOrigin='anonymous'> mode: cors, credentials: same-origin - <audio crossOrigin='use-credentials'> mode: cors, credentials: include This CL includes many changes in LayoutTests/http/tests/fetch/. It is because the credentials mode for script tag is changed from 'same-origin' to 'include'. And fetch's SW-thorough tests are using script tags. I will add browser_tests to check the modes which are set in - MimeHandlerViewContainer for <embed src="test.pdf"> - ManifestFetcher for <link rel="manifest" href="manifest.json"> - PepperURLLoaderHost for PPAPI's pp::URLLoader. https://codereview.chromium.org/1665453003/ BUG=576534, 543895 Committed: https://crrev.com/aac099cc134c503accc16f5b2345023acff04b9e Cr-Commit-Position: refs/heads/master@{#375403}

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+294 lines, -187 lines) Patch
M third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/cors.js View 2 chunks +32 lines, -20 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/cors-preflight.js View 1 chunk +51 lines, -35 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/cors-preflight2.js View 1 chunk +47 lines, -39 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect.js View 6 chunks +46 lines, -43 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect-loop.js View 1 chunk +10 lines, -8 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/serviceworker/fetch-request-resources.html View 5 chunks +63 lines, -15 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/fetch-request-resources-iframe.html View 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/fetch-request-xhr-iframe.html View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp View 2 chunks +33 lines, -21 lines 2 comments Download
M third_party/WebKit/Source/core/loader/ImageLoader.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/fetch/FetchManager.cpp View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/network/ResourceRequest.cpp View 1 chunk +1 line, -4 lines 0 comments Download

Messages

Total messages: 26 (14 generated)
horo
tyoshino@ Could you please review this?
4 years, 10 months ago (2016-02-04 04:16:47 UTC) #10
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/1665533003/diff/1/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp File third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp (left): https://codereview.chromium.org/1665533003/diff/1/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp#oldcode599 third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp:599: ASSERT(!m_fallbackRequestForServiceWorker.isNull() || m_requestContext == WebURLRequest::RequestContextSharedWorker); Did this become removable ...
4 years, 10 months ago (2016-02-04 14:45:26 UTC) #11
horo
https://codereview.chromium.org/1665533003/diff/1/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp File third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp (left): https://codereview.chromium.org/1665533003/diff/1/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp#oldcode599 third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp:599: ASSERT(!m_fallbackRequestForServiceWorker.isNull() || m_requestContext == WebURLRequest::RequestContextSharedWorker); On 2016/02/04 14:45:26, tyoshino ...
4 years, 10 months ago (2016-02-05 02:28:20 UTC) #12
horo
On 2016/02/05 02:28:20, horo wrote: > https://codereview.chromium.org/1665533003/diff/1/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp > File third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp (left): > > https://codereview.chromium.org/1665533003/diff/1/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp#oldcode599 > ...
4 years, 10 months ago (2016-02-05 05:32:35 UTC) #13
tyoshino (SeeGerritForStatus)
lgtm CL description: > This CL includes many changes in LayoutTests/http/tests/fetch/. It is because > ...
4 years, 10 months ago (2016-02-05 07:13:38 UTC) #14
horo
On 2016/02/05 07:13:38, tyoshino wrote: > lgtm > > CL description: > > > This ...
4 years, 10 months ago (2016-02-05 09:18:50 UTC) #16
horo
mkwst@ Could you please review third_party/WebKit/Source/core/loader/* and third_party/WebKit/Source/platform/network/ResourceRequest.cpp?
4 years, 10 months ago (2016-02-05 09:20:56 UTC) #18
Mike West
On 2016/02/05 at 09:20:56, horo wrote: > mkwst@ > > Could you please review third_party/WebKit/Source/core/loader/* ...
4 years, 10 months ago (2016-02-12 09:26:31 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1665533003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1665533003/1
4 years, 10 months ago (2016-02-15 01:46:36 UTC) #21
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 10 months ago (2016-02-15 03:08:53 UTC) #23
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/aac099cc134c503accc16f5b2345023acff04b9e Cr-Commit-Position: refs/heads/master@{#375403}
4 years, 10 months ago (2016-02-16 22:48:41 UTC) #25
horo
4 years, 9 months ago (2016-02-25 08:13:17 UTC) #26
Message was sent while issue was closed.
A revert of this CL (patchset #1 id:1) has been created in
https://codereview.chromium.org/1738753002/ by horo@chromium.org.

The reason for reverting is: This change introduced a security bug.
crbug.com/589740.

Powered by Google App Engine
This is Rietveld 408576698