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

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

Issue 570563003: Implement CSP check for manifest fetching (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed nit from mkwst Created 6 years, 2 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 a70e79ee4d91a7715082acb28f181730f1a634c1..a96f54a11a51d58b52f368128997c3d23c33f83c 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -557,6 +557,12 @@ bool ResourceFetcher::canRequest(Resource::Type type, const ResourceRequest& res
return false;
}
+ // FIXME: Once we use RequestContext for CSP (http://crbug.com/390497), remove this extra check.
+ if (resourceRequest.requestContext() == WebURLRequest::RequestContextManifest) {
+ if (!shouldBypassMainWorldCSP && !csp->allowManifestFromSource(url, cspReporting))
+ return false;
+ }
+
// Measure the number of legacy URL schemes ('ftp://') and the number of embedded-credential
// ('http://user:password@...') resources embedded as subresources. in the hopes that we can
// block them at some point in the future.

Powered by Google App Engine
This is Rietveld 408576698