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

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

Issue 568583003: Allow CSP checkNonce and checkHash to pass with 'unsafe-inline' only. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed broken tests Created 6 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
Index: Source/core/frame/csp/CSPDirectiveList.cpp
diff --git a/Source/core/frame/csp/CSPDirectiveList.cpp b/Source/core/frame/csp/CSPDirectiveList.cpp
index 792472dede5bc17eeba85e09c26d7cd8ba36f8c0..a858d1e7755fb70ac09e81f3baa1b13af2b27b25 100644
--- a/Source/core/frame/csp/CSPDirectiveList.cpp
+++ b/Source/core/frame/csp/CSPDirectiveList.cpp
@@ -78,12 +78,12 @@ bool CSPDirectiveList::checkInline(SourceListDirective* directive) const
bool CSPDirectiveList::checkNonce(SourceListDirective* directive, const String& nonce) const
{
- return !directive || directive->allowNonce(nonce);
+ return !directive || directive->allowNonce(nonce) || checkInline(directive);
}
bool CSPDirectiveList::checkHash(SourceListDirective* directive, const CSPHashValue& hashValue) const
{
- return !directive || directive->allowHash(hashValue);
+ return !directive || directive->allowHash(hashValue) || checkInline(directive);
}
bool CSPDirectiveList::checkSource(SourceListDirective* directive, const KURL& url) const
« no previous file with comments | « LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-multiple-policies-with-unsafe-inline-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698