Skip to content

Commit 8fc13b9

Browse files
EugenSusurrusnejch
authored andcommitted
fix: don't raise RedirectError for redirected HEAD requests
1 parent ba1eec4 commit 8fc13b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gitlab/client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -625,8 +625,8 @@ def _check_redirects(result: requests.Response) -> None:
625625
for item in result.history:
626626
if item.status_code not in (301, 302):
627627
continue
628-
# GET methods can be redirected without issue
629-
if item.request.method == "GET":
628+
# GET and HEAD methods can be redirected without issue
629+
if item.request.method in ("GET", "HEAD"):
630630
continue
631631
target = item.headers.get("location")
632632
raise gitlab.exceptions.RedirectError(

0 commit comments

Comments
 (0)