Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions htpclient/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ def download(url, output, no_header=False):

# Check header
if not no_header:
head = session.head(url)
# not sure if we only should allow 200/301/302, but then it's present for sure
if head.status_code not in [200, 301, 302]:
head = session.head(url, allow_redirects=True)
if not head.ok:
logging.error("File download header reported wrong status code: " + str(head.status_code))
return False

Expand Down