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

Unified Diff: Source/core/frame/csp/ContentSecurityPolicy.cpp

Issue 1302363004: CSP: Suppress violation reports for extension resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Oops. Created 5 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/csp/ContentSecurityPolicy.cpp
diff --git a/Source/core/frame/csp/ContentSecurityPolicy.cpp b/Source/core/frame/csp/ContentSecurityPolicy.cpp
index 0547df0c9f6ad43b0ab4f44cd6bcd4e43ba1c6dd..c85872f3375c04dc7369af1b83f0aa26966fa8d0 100644
--- a/Source/core/frame/csp/ContentSecurityPolicy.cpp
+++ b/Source/core/frame/csp/ContentSecurityPolicy.cpp
@@ -743,6 +743,13 @@ void ContentSecurityPolicy::reportViolation(const String& directiveText, const S
if (reportEndpoints.isEmpty())
return;
+ // TODO(mkwst): Obviously, we shouldn't hit this check, as extension-loaded
+ // resources should be allowed regardless. We apparently do, however, so
+ // we should at least stop spamming reporting endpoints. See
+ // https://crbug.com/524356 for detail.
+ if (!violationData.sourceFile().isEmpty() && SchemeRegistry::schemeShouldBypassContentSecurityPolicy(KURL(ParsedURLString, violationData.sourceFile()).protocol()))
+ return;
+
// We need to be careful here when deciding what information to send to the
// report-uri. Currently, we send only the current document's URL and the
// directive that was violated. The document's URL is safe to send because
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698