docker-ce: allow redir on head requests

This commit is contained in:
Miao Wang 2021-06-14 01:58:18 +08:00
parent a903bd13ab
commit 211e9c5565

View File

@ -108,7 +108,7 @@ def downloading_worker(q):
url, dst_file, working_dir = item
if dst_file.is_file():
print("checking", url, flush=True)
r = requests.head(url, timeout=TIMEOUT_OPTION)
r = requests.head(url, timeout=TIMEOUT_OPTION, allow_redirects=True)
remote_filesize = int(r.headers['content-length'])
remote_date = parsedate_to_datetime(r.headers['last-modified'])
stat = dst_file.stat()