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

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

Issue 133073007: CSP: 'sandbox' should be ignored in report-only mode. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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 | « Source/core/frame/ContentSecurityPolicy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/ContentSecurityPolicy.cpp
diff --git a/Source/core/frame/ContentSecurityPolicy.cpp b/Source/core/frame/ContentSecurityPolicy.cpp
index 4c3cbe42472a78353ff0c53ffac601e356ea6179..970ab2fc211375856023f3fc5efe4338a3702d4e 100644
--- a/Source/core/frame/ContentSecurityPolicy.cpp
+++ b/Source/core/frame/ContentSecurityPolicy.cpp
@@ -1386,6 +1386,10 @@ void CSPDirectiveList::setCSPDirective(const String& name, const String& value,
void CSPDirectiveList::applySandboxPolicy(const String& name, const String& sandboxPolicy)
{
+ if (m_reportOnly) {
+ m_policy->reportInvalidInReportOnly(name);
+ return;
+ }
if (m_haveSandboxPolicy) {
m_policy->reportDuplicateDirective(name);
return;
@@ -1911,6 +1915,11 @@ void ContentSecurityPolicy::reportViolation(const String& directiveText, const S
didSendViolationReport(stringifiedReport);
}
+void ContentSecurityPolicy::reportInvalidInReportOnly(const String& name) const
+{
+ logToConsole("The Content Security Policy directive '" + name + "' is ignored when delivered in a report-only policy.");
+}
+
void ContentSecurityPolicy::reportUnsupportedDirective(const String& name) const
{
DEFINE_STATIC_LOCAL(String, allow, ("allow"));
« no previous file with comments | « Source/core/frame/ContentSecurityPolicy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698