FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: don't raise `RedirectError` for redirected `HEAD` requests · python-gitlab/python-gitlab@8fc13b9 · GitHub

Repository navigation

Commit 8fc13b9

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

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎gitlab/client.py‎

Lines changed: 2 additions & 2 deletions
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)

Back | FazBrowse Home | New Git URL