Auto merge of #8776 - samfoo:hsts-preload-download-fix, r=jdm

Fix the parsing of the chromium HSTS preload list

Urg! The Chromium HSTS preload JSON file contains single line comments. Previously these were filtered out with a very simple regex that just looked for '//' and removed the line. Now the file has added a couple fields that have URLs in them that were erroneously removed and caused the JSON parsing to fail. This commit slightly complicates the regex to fix this specific problem.

If this happens again, it's likely worth it to figure out how to use a real parser to remove the comments.

servo/servo#8760

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8776)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-12-02 10:25:05 +05:30
commit 2be60be062
2 changed files with 5288 additions and 56 deletions

View file

@ -251,7 +251,7 @@ class MachCommands(CommandBase):
# The chromium "json" has single line comments in it which, of course,
# are non-standard/non-valid json. Simply strip them out before parsing
content_json = re.sub(r'//.*$', '', content_decoded, flags=re.MULTILINE)
content_json = re.sub(r'(^|\s+)//.*$', '', content_decoded, flags=re.MULTILINE)
try:
pins_and_static_preloads = json.loads(content_json)

File diff suppressed because it is too large Load diff