Skip to content

Commit

Permalink
fix: don't raise RedirectError for redirected HEAD requests
Browse files Browse the repository at this point in the history
  • Loading branch information
EugenSusurrus authored and nejch committed May 21, 2024
1 parent ba1eec4 commit 8fc13b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gitlab/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,8 @@ def _check_redirects(result: requests.Response) -> None:
for item in result.history:
if item.status_code not in (301, 302):
continue
# GET methods can be redirected without issue
if item.request.method == "GET":
# GET and HEAD methods can be redirected without issue
if item.request.method in ("GET", "HEAD"):
continue
target = item.headers.get("location")
raise gitlab.exceptions.RedirectError(
Expand Down

0 comments on commit 8fc13b9

Please sign in to comment.