From 8e25050f4a3560cd601e728f2dea6137859e717d Mon Sep 17 00:00:00 2001 From: Bernard Cafarelli Date: Tue, 7 Jan 2020 15:35:40 +0100 Subject: [PATCH] Disable Content-disposition check for now Some packages (nextcloud-client) for example have different filename in this header, and so I miss new versions --- pym/euscan/helpers.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pym/euscan/helpers.py b/pym/euscan/helpers.py index 4843a96..639b32d 100644 --- a/pym/euscan/helpers.py +++ b/pym/euscan/helpers.py @@ -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']: