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

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

Issue 2708873002: Stop CSP from matching independent scheme/port upgrades (Closed)
Patch Set: Refactoring port/scheme matching logic to have an easier time with auto-upgrading Created 3 years, 10 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: third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
index f9f6bd3c3e2963d979b0935e5e52baeef8537711..7af3150a0f18efae1c55b680beb04bc98bd3594f 100644
--- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
+++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
@@ -1474,10 +1474,12 @@ bool ContentSecurityPolicy::urlMatchesSelf(const KURL& url) const {
return m_selfSource->matches(url, RedirectStatus::NoRedirect);
}
-bool ContentSecurityPolicy::protocolMatchesSelf(const KURL& url) const {
- if (equalIgnoringCase("http", m_selfProtocol))
- return url.protocolIsInHTTPFamily();
- return equalIgnoringCase(url.protocol(), m_selfProtocol);
+bool ContentSecurityPolicy::protocolEqualsSelf(const String& protocol) const {
+ return equalIgnoringCase(protocol, m_selfProtocol);
+}
+
+const String& ContentSecurityPolicy::getSelfProtocol() const {
+ return m_selfProtocol;
}
bool ContentSecurityPolicy::selfMatchesInnerURL() const {

Powered by Google App Engine
This is Rietveld 408576698