Chromium Code Reviews| 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)) { |
|
yhirano
2014/07/16 13:12:26
Is this block needed because of the same reason as
horo
2014/07/18 09:12:18
Done.
yhirano
2014/07/23 05:17:12
Thanks, please wrap comments in 80 columns.
|
| + 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()); |
| } |