Disable Content-disposition check for now

Some packages (nextcloud-client) for example have different filename in
this header, and so I miss new versions
This commit is contained in:
Bernard Cafarelli 2020-01-07 15:35:40 +01:00
parent 90464f8697
commit 8e25050f4a
No known key found for this signature in database
GPG Key ID: 5A761FC3AEC20F13
1 changed files with 6 additions and 4 deletions

View File

@ -337,10 +337,12 @@ def tryurl(fileurl, template):
headers = fp.info()
if 'Content-disposition' in headers and \
basename not in headers['Content-disposition']:
result = None
elif 'Content-Length' in headers and headers['Content-Length'] == '0':
# Some URLs return Content-disposition with different filename
# Disable check for now (I have no seen false positives)
#if 'Content-disposition' in headers and \
# basename not in headers['Content-disposition']:
# result = None
if 'Content-Length' in headers and headers['Content-Length'] == '0':
result = None
elif 'Content-Type' in headers and \
'text/html' in headers['Content-Type']: