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

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

Issue 1362813002: CSP source *.x.y should not match host x.y (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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/CSPSource.cpp
diff --git a/Source/core/frame/csp/CSPSource.cpp b/Source/core/frame/csp/CSPSource.cpp
index 461f566fc55746d1002d568cc0e85c6d26c70cf2..36ae0f588458c610f766c07efe934c1d0da53653 100644
--- a/Source/core/frame/csp/CSPSource.cpp
+++ b/Source/core/frame/csp/CSPSource.cpp
@@ -44,10 +44,11 @@ bool CSPSource::schemeMatches(const KURL& url) const
bool CSPSource::hostMatches(const KURL& url) const
{
const String& host = url.host();
- if (equalIgnoringCase(host, m_host))
- return true;
- return m_hostWildcard == HasWildcard && host.endsWith("." + m_host, TextCaseInsensitive);
+ if (m_hostWildcard == HasWildcard)
+ return host.endsWith("." + m_host, TextCaseInsensitive);
Mike West 2015/09/23 04:36:49 Can you add a counter here as well, tracking the n
jww 2015/09/23 05:33:10 Done.
+
+ return equalIgnoringCase(host, m_host);
}
bool CSPSource::pathMatches(const KURL& url) const

Powered by Google App Engine
This is Rietveld 408576698