DescriptionReland of 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.
The original change (https://codereview.chromium.org/1665533003/) didn't taint
the response correctly. It was possible to read the body of opaque responses.
(https://crbug.com/589740)
So this change correctly taints the response when the response was returned
from the Service Worker.
BUG=576534, 543895
Committed: https://crrev.com/aa0375d2076441c85069620d7b8c5a29989cde9f
Cr-Commit-Position: refs/heads/master@{#379958}
Patch Set 1 : Copy from https://codereview.chromium.org/1665533003/ #Patch Set 2 : Taint the response from SW #
Total comments: 11
Patch Set 3 : incorporated tyoshino's comment #Messages
Total messages: 19 (10 generated)
|