Merge pull request #10 from spjj/filename-fix

correct handling of filename when not extracted from header
This commit is contained in:
Dongmei Cao 2020-09-25 08:58:25 -07:00 committed by GitHub
commit cbb6838c97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -109,7 +109,7 @@ def download_one_zone(url, output_directory):
if status_code == 200:
# Try to get the filename from the header
_,option = cgi.parse_header(download_zone_response.headers['content-disposition'])
filename = option['filename']
filename = option.get('filename')
# If could get a filename from the header, then makeup one like [tld].txt.gz
if not filename: