Skip to content

Commit 75596f8

Browse files
elhoimclaude
andcommitted
fix: [generator] follow redirects on HEAD request in download_to_file()
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0121gk7vaCXX9bMri7tC9XVd
1 parent 84f0610 commit 75596f8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def download_to_file(url, file, gzip_enable=False, additional_headers={}):
4848
headers = user_agent | additional_headers
4949
try:
5050
logging.info(f'download_to_file - fetching url: {url}')
51-
r = requests.head(url, headers=headers)
51+
r = requests.head(url, headers=headers, allow_redirects=True)
5252
url_datetime = parsedate(r.headers['Last-Modified']).astimezone()
5353
file_datetime = datetime.datetime.fromtimestamp(
5454
path.getmtime(get_abspath_source_file(file))

0 commit comments

Comments
 (0)