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

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: update docs (googleapis.com -> cloudfront.net) 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..65edd0a3aaffb578226972e59369a15c6b7fc8e0 100644
--- a/extensions/common/csp_validator.cc
+++ b/extensions/common/csp_validator.cc
@@ -87,6 +87,11 @@ bool isNonWildcardTLD(const std::string& url,
if (!is_wildcard_subdomain || !should_check_rcd)
return true;
+ // Allow *.googleapis.com to be whitelisted for backwards-compatibility.
+ // (crbug.com/409952)
+ if (host == "googleapis.com")
+ return true;
+
// Wildcards on subdomains of a TLD are not allowed.
size_t registry_length = net::registry_controlled_domains::GetRegistryLength(
host,

Powered by Google App Engine
This is Rietveld 408576698