Skip to content

Commit 4e7e6cb

Browse files
author
jessevz
committed
Support redirect for head request for downloads
1 parent a6b87e3 commit 4e7e6cb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

htpclient/download.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def download(url, output, no_header=False):
1717

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

0 commit comments

Comments
 (0)