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

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

Issue 549163003: CSP: Change 'self' to ask the policy object whether a URL matches. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: httpfamily 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
« no previous file with comments | « no previous file | Source/core/frame/csp/CSPSourceList.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/csp/CSPSource.cpp
diff --git a/Source/core/frame/csp/CSPSource.cpp b/Source/core/frame/csp/CSPSource.cpp
index bcd510b83053e2afbeb0037d882ee5393bb83f51..1202b0aca47a760e5d46f9e985281cd544fc86e0 100644
--- a/Source/core/frame/csp/CSPSource.cpp
+++ b/Source/core/frame/csp/CSPSource.cpp
@@ -35,12 +35,8 @@ bool CSPSource::matches(const KURL& url) const
bool CSPSource::schemeMatches(const KURL& url) const
{
- if (m_scheme.isEmpty()) {
- String protectedResourceScheme(m_policy->securityOrigin()->protocol());
- if (equalIgnoringCase("http", protectedResourceScheme))
- return url.protocolIs("http") || url.protocolIs("https");
- return equalIgnoringCase(url.protocol(), protectedResourceScheme);
- }
+ if (m_scheme.isEmpty())
+ return m_policy->protocolMatchesSelf(url);
return equalIgnoringCase(url.protocol(), m_scheme);
}
« no previous file with comments | « no previous file | Source/core/frame/csp/CSPSourceList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698