fix: [hhhash] we don't want to follow HTTP redirects for HHHash

This commit is contained in:
Alexandre Dulaunoy 2023-08-22 14:32:57 +02:00
parent b6eec03adc
commit 5c4f820449
Signed by: adulau
GPG key ID: 09E2CD4944E6CBCD

View file

@ -16,9 +16,9 @@ def buildhash(url=None, debug=False, method='GET', timeout=5):
if url is None:
return False
if method == 'GET':
r = requests.get(url, timeout=timeout)
r = requests.get(url, timeout=timeout, allow_redirects=False)
elif method == 'HEAD':
r = requests.head(url, timeout=timeout)
r = requests.head(url, timeout=timeout, allow_redirects=False)
else:
return False
hhhash = ""