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

Unified Diff: third_party/WebKit/Source/core/frame/csp/CSPSource.cpp

Issue 1455973003: CSP: Source expressions can no longer lock sites into insecurity. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | third_party/WebKit/Source/core/frame/csp/CSPSourceListTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/csp/CSPSource.cpp
diff --git a/third_party/WebKit/Source/core/frame/csp/CSPSource.cpp b/third_party/WebKit/Source/core/frame/csp/CSPSource.cpp
index 5be05dad47dd1f5708ded735ec26620edb5355a0..e2b6b18f6549815ae55cbc8133e560706f54c376 100644
--- a/third_party/WebKit/Source/core/frame/csp/CSPSource.cpp
+++ b/third_party/WebKit/Source/core/frame/csp/CSPSource.cpp
@@ -39,6 +39,10 @@ bool CSPSource::schemeMatches(const KURL& url) const
{
if (m_scheme.isEmpty())
return m_policy->protocolMatchesSelf(url);
+ if (equalIgnoringCase(m_scheme, "http"))
+ return equalIgnoringCase(url.protocol(), "http") || equalIgnoringCase(url.protocol(), "https");
+ if (equalIgnoringCase(m_scheme, "ws"))
+ return equalIgnoringCase(url.protocol(), "ws") || equalIgnoringCase(url.protocol(), "wss");
return equalIgnoringCase(url.protocol(), m_scheme);
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/csp/CSPSourceListTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698