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

Unified Diff: content/common/content_security_policy/csp_context.cc

Issue 2893613002: PlzNavigate: Fix "Only one CSP is reported instead of several". (Closed)
Patch Set: Rebase Created 3 years, 7 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: content/common/content_security_policy/csp_context.cc
diff --git a/content/common/content_security_policy/csp_context.cc b/content/common/content_security_policy/csp_context.cc
index 0ba1e1830b7ce900a79afab51894e4cdd8aed08f..194a8a19811bf9be020efb38fce3386aee4b8289 100644
--- a/content/common/content_security_policy/csp_context.cc
+++ b/content/common/content_security_policy/csp_context.cc
@@ -17,12 +17,12 @@ bool CSPContext::IsAllowedByCsp(CSPDirective::Name directive_name,
if (SchemeShouldBypassCSP(url.scheme_piece()))
return true;
+ bool allow = true;
for (const auto& policy : policies_) {
- if (!ContentSecurityPolicy::Allow(policy, directive_name, url, is_redirect,
- this, source_location))
- return false;
+ allow &= ContentSecurityPolicy::Allow(policy, directive_name, url,
+ is_redirect, this, source_location);
}
- return true;
+ return allow;
}
void CSPContext::SetSelf(const url::Origin origin) {

Powered by Google App Engine
This is Rietveld 408576698