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

Unified Diff: content/common/content_security_policy/csp_context.cc

Issue 2792013002: Stop CSP from matching independent scheme/port upgrades (content layer) (Closed)
Patch Set: Format changes Created 3 years, 8 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: content/common/content_security_policy/csp_context.cc
diff --git a/content/common/content_security_policy/csp_context.cc b/content/common/content_security_policy/csp_context.cc
index 3d3c9a01da198e9f5381f76ab2b90ba970fa2e87..ab249dd3f25840268f907498e737c57f4e1f32eb 100644
--- a/content/common/content_security_policy/csp_context.cc
+++ b/content/common/content_security_policy/csp_context.cc
@@ -52,14 +52,16 @@ bool CSPContext::AllowSelf(const GURL& url) {
return has_self_ && CSPSource::Allow(self_source_, url, this);
}
-bool CSPContext::ProtocolMatchesSelf(const GURL& url) {
+bool CSPContext::ProtocolIsSelf(const GURL& url) {
if (!has_self_)
return false;
- if (self_scheme_ == url::kHttpScheme)
- return url.SchemeIsHTTPOrHTTPS() || url.SchemeIsSuborigin();
return url.SchemeIs(self_scheme_);
}
+const std::string& CSPContext::GetSelfScheme() {
+ return self_scheme_;
+}
+
bool CSPContext::SchemeShouldBypassCSP(const base::StringPiece& scheme) {
return false;
}
« no previous file with comments | « content/common/content_security_policy/csp_context.h ('k') | content/common/content_security_policy/csp_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698