Chromium Code Reviews| Index: components/domain_reliability/bake_in_configs.py |
| diff --git a/components/domain_reliability/bake_in_configs.py b/components/domain_reliability/bake_in_configs.py |
| index 8cee936d7585d4020bde4f773149942531e2ec06..8da3432cbd7d316736833022b89112c51a27a7fe 100755 |
| --- a/components/domain_reliability/bake_in_configs.py |
| +++ b/components/domain_reliability/bake_in_configs.py |
| @@ -475,7 +475,11 @@ def read_json_files_from_gypi(gypi_file): |
| return json_files |
| -def domain_is_whitelisted(domain): |
| +def origin_is_whitelisted(origin): |
| + if origin.startswith('https://') and origin.endswith('/'): |
| + domain = origin[8:-1] |
| + else: |
| + return False |
| return any(domain == e or domain.endswith('.' + e) for e in DOMAIN_WHITELIST) |
| @@ -526,14 +530,14 @@ def main(): |
| print >> sys.stderr, "%s: error parsing JSON: %s" % (json_file, e) |
| found_invalid_config = True |
| continue |
| - if 'monitored_domain' not in config: |
|
Randy Smith (Not in Mondays)
2015/10/29 22:36:10
Just confirming that all the .json files being par
Deprecated (see juliatuttle)
2015/11/02 23:19:30
Yes. We're not accepting *anything* from the web y
|
| - print >> sys.stderr, '%s: no monitored_domain found' % json_file |
| + if 'origin' not in config: |
| + print >> sys.stderr, '%s: no origin found' % json_file |
| found_invalid_config = True |
| continue |
| - domain = config['monitored_domain'] |
| - if not domain_is_whitelisted(domain): |
| - print >> sys.stderr, ('%s: monitored_domain "%s" not in whitelist' % |
| - (json_file, domain)) |
| + origin = config['origin'] |
| + if not origin_is_whitelisted(origin): |
| + print >> sys.stderr, ('%s: origin "%s" not in whitelist' % |
| + (json_file, origin)) |
| found_invalid_config = True |
| continue |