Skip to content
Permalink
Browse files

Dashboard: Add protection against huge reports

  • Loading branch information...
oschuett committed Aug 7, 2019
1 parent 4d81104 commit a20a5e097a2d791935ba1b48f57788d254e64249
Showing with 4 additions and 0 deletions.
  1. +4 −0 tools/dashboard/generate_dashboard.py
@@ -556,6 +556,10 @@ def retrieve_report(url):
if r.status_code == 304: # Not Modified - cache hit
return data_file.read_text()

# check report size
report_size = int(r.headers['Content-Length'])
assert report_size < 3*1024*1024 # 3 MB

# cache miss - store response
if 'ETag' in r.headers:
data_file.write_text(r.text)

0 comments on commit a20a5e0

Please sign in to comment.
You can’t perform that action at this time.