New issue
Advanced search Search tips

Issue 658249 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Components:
EstimatedDays: ----
NextAction: 2017-03-03
OS: All
Pri: 1
Type: Bug

Blocking:
issue 669363



Sign in to add a comment

chrome permits redirected Response objects to be passed to FetchEvent.respondWith()

Reported by bke...@mozilla.com, Oct 21 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:50.0) Gecko/20100101 Firefox/50.0

Steps to reproduce the problem:
1. Go to https://gdgnd-devfest16.firebaseapp.com/
2. Reload page after it's been loaded

What is the expected behavior?
The page should fail to load when reloaded after the service worker is installed and controlling the page.

What went wrong?
The service worker on the page has a bug per the spec and should fail to load:

1) The page pre-cache install is caching /index.html which redirects to /.
2) In the fetch even the top level page is normalized back to index.html and looks this response up in the Cache API.
3) Returning a redirected Response to a navigation with redirect mode manual is illegal per the spec.

Step 3 results in a failure in firefox, but chrome accepts it.  This is against the spec.

See HTTP Fetch step 3.3.3:

https://fetch.spec.whatwg.org/#http-fetch

Did this work before? No 

Does this work in other browsers? Yes

Chrome version: 56.0.2896.0 (Official Build) canary (64-bit)  Channel: n/a
OS Version: 10.0
Flash Version: Shockwave Flash 23.0 r0

It may be that this check for redirected Response objects may just not have been implemented yet.  Its also possible that the Cache API in chrome is incorrectly losing the redirected status of the Response.
 

Comment 1 by horo@chromium.org, Oct 24 2016

The install handler of the service worker is caching the redirected response.
-------------
https://gdgnd-devfest16.firebaseapp.com/service-worker.js
-------------
self.addEventListener('install', function(event) {
  ......
  return fetch(request).then(function(response) {
    if (response.ok) {
      return cache.put(CurrentCacheNamesToAbsoluteUrl[cacheName],
        response);
    }
     .......
  });
  ......
});
---------------
request.url is "https://gdgnd-devfest16.firebaseapp.com/index.html".
But response.url is "https://gdgnd-devfest16.firebaseapp.com/".

The response type is "basic". And the status is 200 (not 301).
The service worker returns the "basic" Response to a navigation with redirect mode manual.
So I think it is working as intended.

Comment 2 by bke...@mozilla.com, Oct 24 2016

The redirected response should have more than one URL in its URL list and therefore `response.redirected' set to true.  This should then cause the response to fail the 4th bullet of step 3.3.3 here:

  https://fetch.spec.whatwg.org/#http-fetch

It says:

  `request's redirect mode is not "follow" and response's url list has more than one item.`

I guess perhaps chrome has not implemented this restriction yet.  I don't see the `Response.redirected` attribute in chrome or canary.

This was changed in the spec here:

  https://github.com/whatwg/fetch/commit/e54f6bd1e75f46cd4b8202f5ee3bfa68e9ded906

In order to fix this security related spec issue raised by Alex and Eduardo:

  https://github.com/whatwg/fetch/issues/79

Comment 3 by horo@chromium.org, Oct 25 2016

Labels: -OS-Windows -Pri-2 OS-All Pri-1
Owner: horo@chromium.org
Status: Assigned (was: Unconfirmed)
Ah, I got it.
Thank you for the explanation.

Comment 4 by horo@chromium.org, Nov 21 2016

Status: Started (was: Assigned)

Comment 6 by horo@chromium.org, Nov 29 2016

Blocking: 669363
Project Member

Comment 7 by bugdroid1@chromium.org, Dec 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/756089ad4639bb917faac4b2f6a83c16370f10b6

commit 756089ad4639bb917faac4b2f6a83c16370f10b6
Author: horo <horo@chromium.org>
Date: Thu Dec 08 14:34:03 2016

Introduce url_list to the Response scheme of CacheStorage.

According to the spec, the CacheStorage has to store the URL list of responses.
https://github.com/w3c/ServiceWorker/issues/737#issuecomment-175844226
So this cl introduces url_list to the Response scheme of CacheStorage, and pass
it from FetchManager::Loader to CacheStorage and ServiceWorkerURLRequestJob and
ResourceResponse.

To let FetchManager::Loader know the URL list, this cl introduces
ThreadableLoaderClient::didReceiveRedirectTo(). DocumentThreadableLoader calls
didReceiveRedirectTo() when it received a redirect response.
- If fetch() in called on the main thread, FetchManager::Loader's
  didReceiveRedirectTo() is called directly from DocumentThreadableLoader.
- If fetch() is called on the worker thread, FetchManager::Loader's
  didReceiveRedirectTo() is called via WorkerThreadableLoader::
  MainThreadLoaderHolder.
And FetchManager::Loader::didReceiveResponse() sets the URL list to
FetchResponseData.

When FetchEvent.respondWith(response) is called in the SW, the URL list is
passed to ServiceWorkerURLRequestJob via blink::WebServiceWorkerResponse and
content::ServiceWorkerResponse. And when the browser process sends the response
to the controlled page, the URL list is passed via content::ResourceResponseInfo
and blink::WebURLResponse and blink::ResourceResponse.

If Cache.put(request, response) is called, the URL list is passed to
CacheStorageCache::Put() via blink::WebServiceWorkerResponse and
content::ServiceWorkerResponse. And it converts the list to the protobuf and
save to the storage.

When Cache.match(request) returns the response to the renderer process, the URL
list is read from the protobuf in the storage and passed via
content::ServiceWorkerResponse and blink::WebServiceWorkerResponse to the
renderer process.

BUG= 658249 

Review-Url: https://codereview.chromium.org/2516353002
Cr-Commit-Position: refs/heads/master@{#437241}

[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/content/browser/cache_storage/cache_storage.proto
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/content/browser/cache_storage/cache_storage_cache.cc
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/content/browser/cache_storage/cache_storage_cache_unittest.cc
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/content/browser/cache_storage/cache_storage_manager_unittest.cc
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/content/browser/service_worker/embedded_worker_test_helper.cc
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/content/browser/service_worker/service_worker_response_info.cc
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/content/browser/service_worker/service_worker_response_info.h
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/content/browser/service_worker/service_worker_url_request_job.cc
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/content/browser/service_worker/service_worker_url_request_job.h
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/content/browser/service_worker/service_worker_url_request_job_unittest.cc
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/content/child/web_url_loader_impl.cc
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/content/common/resource_messages.h
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/content/common/service_worker/service_worker_messages.h
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/content/common/service_worker/service_worker_types.cc
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/content/common/service_worker/service_worker_types.h
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/content/public/common/resource_response.cc
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/content/public/common/resource_response_info.h
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/content/renderer/cache_storage/cache_storage_dispatcher.cc
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/content/renderer/service_worker/service_worker_context_client.cc
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/content/renderer/service_worker/service_worker_type_util.cc
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/content/renderer/service_worker/service_worker_type_util.h
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/media/blink/multibuffer_data_source_unittest.cc
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/third_party/WebKit/Source/core/loader/ThreadableLoaderClient.h
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/third_party/WebKit/Source/core/loader/WorkerThreadableLoader.cpp
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/third_party/WebKit/Source/core/loader/WorkerThreadableLoader.h
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/third_party/WebKit/Source/modules/cachestorage/CacheTest.cpp
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/third_party/WebKit/Source/modules/fetch/FetchResponseData.h
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/third_party/WebKit/Source/modules/fetch/FetchResponseDataTest.cpp
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/third_party/WebKit/Source/modules/fetch/Response.cpp
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/third_party/WebKit/Source/modules/fetch/ResponseTest.cpp
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/third_party/WebKit/Source/modules/serviceworkers/FetchEvent.cpp
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/third_party/WebKit/Source/platform/exported/WebServiceWorkerResponse.cpp
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/third_party/WebKit/Source/platform/exported/WebURLResponse.cpp
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/third_party/WebKit/Source/platform/network/ResourceResponse.cpp
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/third_party/WebKit/Source/platform/network/ResourceResponse.h
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/third_party/WebKit/public/platform/WebURLResponse.h
[modify] https://crrev.com/756089ad4639bb917faac4b2f6a83c16370f10b6/third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerResponse.h

Project Member

Comment 8 by bugdroid1@chromium.org, Dec 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/00af5e1dbf656a0b8f308583750d1e69c12b1148

commit 00af5e1dbf656a0b8f308583750d1e69c12b1148
Author: horo <horo@chromium.org>
Date: Fri Dec 09 14:32:45 2016

Add LayoutTests for URL list of Response

https://codereview.chromium.org/2516353002/ introduces URL list of Response.

This URL list is an internal value which is not exposed to script.
To check the list in the LayoutTest, this CL introduces an internal API
getInternalResponseURLList().

BUG= 658249 

Review-Url: https://codereview.chromium.org/2550363002
Cr-Commit-Position: refs/heads/master@{#437533}

[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/LayoutTests/http/tests/fetch/resources/redirect-loop.php
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/LayoutTests/http/tests/fetch/resources/thorough-util.js
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/response.js
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect-loop.js
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect-nocors.js
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect-password.js
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect.js
[add] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/LayoutTests/http/tests/serviceworker/redirected-response.html
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/core/core_idl_files.gni
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/BUILD.gn
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/fetch/FetchResponseData.h
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/fetch/Response.cpp
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/fetch/Response.h
[add] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/fetch/testing/InternalsFetch.cpp
[add] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/fetch/testing/InternalsFetch.h
[add] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/fetch/testing/InternalsFetch.idl
[add] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/fetch/testing/WorkerInternalsFetch.cpp
[add] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/fetch/testing/WorkerInternalsFetch.h
[add] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/fetch/testing/WorkerInternalsFetch.idl
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/modules_idl_files.gni
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/web/WebTestingSupport.cpp

Project Member

Comment 9 by bugdroid1@chromium.org, Dec 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/00af5e1dbf656a0b8f308583750d1e69c12b1148

commit 00af5e1dbf656a0b8f308583750d1e69c12b1148
Author: horo <horo@chromium.org>
Date: Fri Dec 09 14:32:45 2016

Add LayoutTests for URL list of Response

https://codereview.chromium.org/2516353002/ introduces URL list of Response.

This URL list is an internal value which is not exposed to script.
To check the list in the LayoutTest, this CL introduces an internal API
getInternalResponseURLList().

BUG= 658249 

Review-Url: https://codereview.chromium.org/2550363002
Cr-Commit-Position: refs/heads/master@{#437533}

[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/LayoutTests/http/tests/fetch/resources/redirect-loop.php
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/LayoutTests/http/tests/fetch/resources/thorough-util.js
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/response.js
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect-loop.js
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect-nocors.js
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect-password.js
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect.js
[add] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/LayoutTests/http/tests/serviceworker/redirected-response.html
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/core/core_idl_files.gni
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/BUILD.gn
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/fetch/FetchResponseData.h
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/fetch/Response.cpp
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/fetch/Response.h
[add] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/fetch/testing/InternalsFetch.cpp
[add] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/fetch/testing/InternalsFetch.h
[add] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/fetch/testing/InternalsFetch.idl
[add] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/fetch/testing/WorkerInternalsFetch.cpp
[add] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/fetch/testing/WorkerInternalsFetch.h
[add] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/fetch/testing/WorkerInternalsFetch.idl
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/modules/modules_idl_files.gni
[modify] https://crrev.com/00af5e1dbf656a0b8f308583750d1e69c12b1148/third_party/WebKit/Source/web/WebTestingSupport.cpp

Project Member

Comment 10 by bugdroid1@chromium.org, Dec 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ca86b8af14cf71407b6e7ed342c8dbeb268dd51e

commit ca86b8af14cf71407b6e7ed342c8dbeb268dd51e
Author: horo <horo@chromium.org>
Date: Fri Dec 09 16:25:50 2016

Introduce Response.redirected attribute and add LayoutTest.

https://codereview.chromium.org/2516353002/ introduces URL list of Response.
Response.redirected returns true when the size of the list is larger than 1.

BUG= 658249 

Review-Url: https://codereview.chromium.org/2524703002
Cr-Commit-Position: refs/heads/master@{#437555}

[modify] https://crrev.com/ca86b8af14cf71407b6e7ed342c8dbeb268dd51e/third_party/WebKit/LayoutTests/http/tests/fetch/resources/thorough-util.js
[modify] https://crrev.com/ca86b8af14cf71407b6e7ed342c8dbeb268dd51e/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js
[modify] https://crrev.com/ca86b8af14cf71407b6e7ed342c8dbeb268dd51e/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/response.js
[modify] https://crrev.com/ca86b8af14cf71407b6e7ed342c8dbeb268dd51e/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect-loop.js
[modify] https://crrev.com/ca86b8af14cf71407b6e7ed342c8dbeb268dd51e/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect-nocors.js
[modify] https://crrev.com/ca86b8af14cf71407b6e7ed342c8dbeb268dd51e/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect-password.js
[modify] https://crrev.com/ca86b8af14cf71407b6e7ed342c8dbeb268dd51e/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect.js
[modify] https://crrev.com/ca86b8af14cf71407b6e7ed342c8dbeb268dd51e/third_party/WebKit/LayoutTests/http/tests/serviceworker/redirected-response.html
[modify] https://crrev.com/ca86b8af14cf71407b6e7ed342c8dbeb268dd51e/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[modify] https://crrev.com/ca86b8af14cf71407b6e7ed342c8dbeb268dd51e/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/ca86b8af14cf71407b6e7ed342c8dbeb268dd51e/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[modify] https://crrev.com/ca86b8af14cf71407b6e7ed342c8dbeb268dd51e/third_party/WebKit/LayoutTests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[modify] https://crrev.com/ca86b8af14cf71407b6e7ed342c8dbeb268dd51e/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt
[modify] https://crrev.com/ca86b8af14cf71407b6e7ed342c8dbeb268dd51e/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/ca86b8af14cf71407b6e7ed342c8dbeb268dd51e/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt
[modify] https://crrev.com/ca86b8af14cf71407b6e7ed342c8dbeb268dd51e/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt
[modify] https://crrev.com/ca86b8af14cf71407b6e7ed342c8dbeb268dd51e/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/ca86b8af14cf71407b6e7ed342c8dbeb268dd51e/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt
[modify] https://crrev.com/ca86b8af14cf71407b6e7ed342c8dbeb268dd51e/third_party/WebKit/Source/modules/fetch/FetchResponseData.h
[modify] https://crrev.com/ca86b8af14cf71407b6e7ed342c8dbeb268dd51e/third_party/WebKit/Source/modules/fetch/Response.cpp
[modify] https://crrev.com/ca86b8af14cf71407b6e7ed342c8dbeb268dd51e/third_party/WebKit/Source/modules/fetch/Response.h
[modify] https://crrev.com/ca86b8af14cf71407b6e7ed342c8dbeb268dd51e/third_party/WebKit/Source/modules/fetch/Response.idl

Comment 12 by horo@chromium.org, Jan 6 2017

I don't know why, but bugdroid1@ didn't add comments about this patch.


commit 82298e59225ddfab0402b77c265624acb29632a4
Author: horo <horo@chromium.org>
Date:   Mon Dec 12 21:21:15 2016 -0800

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 

Review-Url: https://codereview.chromium.org/2526343003
Cr-Commit-Position: refs/heads/master@{#438063}

Comment 13 by horo@chromium.org, Jan 6 2017

NextAction: 2017-03-03
After 57.0.2951.0, Chrome shows the error messages on DevTools.

As I announced in blink-dev, I will introduce the restriction in M59.
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/ZPaAeG3N0tw
gdgnd-error.png
137 KB View Download

Comment 15 by horo@chromium.org, Mar 30 2017

Status: Fixed (was: Started)
343f57b30319e935a538ef99853a8eaafe7926e5 is in 59.0.3045.0
Project Member

Comment 16 by bugdroid1@chromium.org, Apr 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/79db0f5060f3594ec0c84196da9f3ab294c0cacd

commit 79db0f5060f3594ec0c84196da9f3ab294c0cacd
Author: horo <horo@chromium.org>
Date: Tue Apr 18 11:33:32 2017

Remove unused deprecation message of the service worker redirected response restriction.

I forgot to remove this message in https://codereview.chromium.org/2755643004.

BUG= 658249 

Review-Url: https://codereview.chromium.org/2819423003
Cr-Commit-Position: refs/heads/master@{#465198}

[modify] https://crrev.com/79db0f5060f3594ec0c84196da9f3ab294c0cacd/third_party/WebKit/Source/core/frame/Deprecation.cpp
[modify] https://crrev.com/79db0f5060f3594ec0c84196da9f3ab294c0cacd/third_party/WebKit/Source/core/loader/DocumentLoader.cpp

Project Member

Comment 17 by bugdroid1@chromium.org, May 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/732f505038a242a0353375cc78126b3956650b16

commit 732f505038a242a0353375cc78126b3956650b16
Author: mike <mike@mikepennisi.com>
Date: Fri May 19 17:12:15 2017

Upstream srvc wrkr "redirected resp" test to WPT

Reformat the test in terms of a series of distinct sub-tests with
expressive titles. This provides more expressive feedback in the event of
test failure. It also makes test results deterministic in the event of
multiple test failures.

Create a new version of this test that omits references to internal APIs
and place that in the "external" directory for eventual contribution to the
Web Platform Tests project.

Re-name the original test file to explicitly document its role as a
Chromium-specific test and limit its assertions to only those internal
details.

BUG= 688116 ,  658249 
R=falken@chromium.org

Review-Url: https://codereview.chromium.org/2878003003
Cr-Commit-Position: refs/heads/master@{#473221}

[add] https://crrev.com/732f505038a242a0353375cc78126b3956650b16/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/redirected-response.https.html
[add] https://crrev.com/732f505038a242a0353375cc78126b3956650b16/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium.redirected-response.html
[delete] https://crrev.com/9fe4c439346a542a207dc9122fe68b8a40f68dcd/third_party/WebKit/LayoutTests/http/tests/serviceworker/redirected-response.html

Sign in to add a comment