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

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

Issue 333423004: moved to https://codereview.chromium.org/399543002/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: cleanup test Created 6 years, 5 months 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
Index: Source/core/fetch/ResourceFetcher.cpp
diff --git a/Source/core/fetch/ResourceFetcher.cpp b/Source/core/fetch/ResourceFetcher.cpp
index c0f8ac0d71f222a3ca0455eb20b72ac10e6cadf1..821d4cad53db9b241252e9b88448f8abd8e60488 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -1313,7 +1313,13 @@ void ResourceFetcher::willSendRequest(unsigned long identifier, ResourceRequest&
void ResourceFetcher::didReceiveResponse(const Resource* resource, const ResourceResponse& response)
{
- // FIXME: When response.wasFetchedViaServiceWorker() is true, we need to check the URL of the responce for CSP and CORS.
+ if (response.wasFetchedViaServiceWorker()) {
+ if (!canRequest(resource->type(), response.url(), resource->options(), false, FetchRequest::UseDefaultOriginRestrictionForType)) {
+ resource->loader()->cancel();
+ context().dispatchDidFail(m_documentLoader, resource->identifier(), ResourceError(errorDomainBlinkInternal, 0, response.url().string(), "Original url check of ServiceWorker fetched resource failed."));
+ return;
+ }
+ }
context().dispatchDidReceiveResponse(m_documentLoader, resource->identifier(), response, resource->loader());
}
« no previous file with comments | « LayoutTests/http/tests/serviceworker/resources/redirect.php ('k') | Source/core/loader/DocumentThreadableLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698