Revert "Merge branch 'random-fixes' into 'master'"

This reverts merge request !605
This commit is contained in:
Marcus 2019-01-10 13:46:49 +00:00
parent 357dea762d
commit f6f2fb0b89
6 changed files with 8 additions and 51 deletions

View file

@ -36,7 +36,7 @@ def download_file(url, local_filename=None, dldir='tmp'):
return local_filename
def http_get(url, etag=None, timeout=600):
def http_get(url, etag=None):
"""
Downloads the content from the given URL by making a GET request.
@ -52,12 +52,12 @@ def http_get(url, etag=None, timeout=600):
# TODO disable TLS Session IDs and TLS Session Tickets
# (plain text cookie visible to anyone who can see the network traffic)
if etag:
r = requests.head(url, headers=headers, timeout=timeout)
r = requests.head(url, headers=headers)
r.raise_for_status()
if 'ETag' in r.headers and etag == r.headers['ETag']:
return None, etag
r = requests.get(url, headers=headers, timeout=timeout)
r = requests.get(url, headers=headers)
r.raise_for_status()
new_etag = None