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

Unified Diff: Source/core/fetch/ResourceFetcher.cpp

Issue 732003002: Use the request URL as the URL of the resources which are fetched ServiceWorker [3/3 blink] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add comment Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/http/tests/serviceworker/resources/fetch-request-css-base-url-worker.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/ResourceFetcher.cpp
diff --git a/Source/core/fetch/ResourceFetcher.cpp b/Source/core/fetch/ResourceFetcher.cpp
index f02e9de872bdaa8948d6bbef2372e434e51c6adb..9860b16d4a0a92dd18a6048e165b244dbb29b2fc 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -1350,11 +1350,9 @@ void ResourceFetcher::didReceiveResponse(const Resource* resource, const Resourc
MixedContentChecker::checkMixedPrivatePublic(frame(), response.remoteIPAddress());
// If the response is fetched via ServiceWorker, the original URL of the response could be different from the URL of the request.
+ // We check the URL not to load the resources which are forbidden by the page CSP. This behavior is not specified in the CSP specification yet.
if (response.wasFetchedViaServiceWorker()) {
- KURL originalURL = response.url();
- // FIXME: Use response.originalURLViaServiceWorker() after the chromium side patch will land.
- if (!response.originalURLViaServiceWorker().isEmpty())
- originalURL = response.originalURLViaServiceWorker();
+ const KURL& originalURL = response.originalURLViaServiceWorker();
if (!canRequest(resource->type(), resource->resourceRequest(), originalURL, resource->options(), false, FetchRequest::UseDefaultOriginRestrictionForType)) {
resource->loader()->cancel();
bool isInternalRequest = resource->options().initiatorInfo.name == FetchInitiatorTypeNames::internal;
« no previous file with comments | « LayoutTests/http/tests/serviceworker/resources/fetch-request-css-base-url-worker.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698