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

Unified Diff: extensions/common/csp_validator.cc

Issue 673183003: Allow *.googleapis.com to be used in CSP (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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: extensions/common/csp_validator.cc
diff --git a/extensions/common/csp_validator.cc b/extensions/common/csp_validator.cc
index fc3f541a041bfc0c30db7360e0bd8ec37895b65d..8992e8013ee10949282863f90de1b25cd6f9e80b 100644
--- a/extensions/common/csp_validator.cc
+++ b/extensions/common/csp_validator.cc
@@ -87,6 +87,12 @@ bool isNonWildcardTLD(const std::string& url,
if (!is_wildcard_subdomain || !should_check_rcd)
return true;
+ // Allow *.googleapis.com to be whitelisted for backwards-compatibility.
+ // AWS has registered several public suffixes but hosts the user-generated
+ // content directly under the public suffix without a subdomain.
not at google - send to devlin 2014/10/24 22:16:51 Reference that bug here. Also some examples in the
robwu 2014/10/24 22:34:08 Done.
+ if (host == "googleapis.com" || EndsWith(host, ".amazonaws.com", true))
+ return true;
+
// Wildcards on subdomains of a TLD are not allowed.
size_t registry_length = net::registry_controlled_domains::GetRegistryLength(
host,
« no previous file with comments | « no previous file | extensions/common/csp_validator_unittest.cc » ('j') | extensions/common/csp_validator_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698