diff options
Diffstat (limited to 'scripts/check-lorry-urls')
-rwxr-xr-x | scripts/check-lorry-urls | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/check-lorry-urls b/scripts/check-lorry-urls index 0829684..92037ab 100755 --- a/scripts/check-lorry-urls +++ b/scripts/check-lorry-urls @@ -115,11 +115,14 @@ def check_file(filename): with urllib.request.urlopen( urllib.request.Request(upstream_url, method='HEAD')) as result: - pass + if result.info().get('Content-Type') == 'text/html': + error('Content-Type is HTML') + elif result.info().get('Content-Length') == '0': + error('file is empty') + else: + info('OK') except (urllib.error.URLError, http.client.HTTPException) as e: error(str(e)) - else: - info('OK') # Throttle requests time.sleep(0.1) |