Skip to content

Commit

Permalink
Allow initial HEAD to use redirects in lazy_wheel
Browse files Browse the repository at this point in the history
Fixes #9039
  • Loading branch information
thatch committed Feb 27, 2024
1 parent e8329d4 commit 95c3981
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/poetry/inspection/lazy_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def _content_length_from_head(self) -> int:
:raises HTTPRangeRequestUnsupported: if the response fails to indicate support
for "bytes" ranges."""
self._request_count += 1
head = self._session.head(self._url, headers=self._uncached_headers())
head = self._session.head(self._url, headers=self._uncached_headers(), allow_redirects=True)
head.raise_for_status()
assert head.status_code == codes.ok
accepted_range = head.headers.get("Accept-Ranges", None)
Expand Down
2 changes: 1 addition & 1 deletion src/poetry/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
RETRY_AFTER_HEADER = "retry-after"

# Server response codes to retry requests on.
STATUS_FORCELIST = [429, 500, 501, 502, 503, 504]
STATUS_FORCELIST = [429, 500, 502, 503, 504]

0 comments on commit 95c3981

Please sign in to comment.