Skip to content

Commit

Permalink
Remove Authorization header when following redirects (#1345)
Browse files Browse the repository at this point in the history
  • Loading branch information
XciD authored Feb 17, 2023
1 parent d7378dd commit 4d3d150
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/huggingface_hub/file_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,7 @@ def cached_download(
# Useful for lfs blobs that are stored on a CDN.
if 300 <= r.status_code <= 399:
url_to_download = r.headers["Location"]
headers.pop("authorization", None)
except (requests.exceptions.SSLError, requests.exceptions.ProxyError):
# Actually raise for those subclasses of ConnectionError
raise
Expand Down

0 comments on commit 4d3d150

Please sign in to comment.