Skip to content

Commit d3d662f

Browse files
iomarmochtarJohnVillalovos
authored andcommitted
fix: set the original base url when found change in next url
1 parent f6b6e18 commit d3d662f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

gitlab/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"""Wrapper for the GitLab API."""
1818

1919
import os
20+
import re
2021
import time
2122
from typing import Any, cast, Dict, List, Optional, Tuple, TYPE_CHECKING, Union
2223

@@ -1112,6 +1113,8 @@ def _query(
11121113
next_url = requests.utils.parse_header_links(result.headers["links"])[
11131114
0
11141115
]["url"]
1116+
if not next_url.startswith(self._gl._base_url):
1117+
next_url = re.sub(r"^.*?/api", f"{self._gl._base_url}/api", next_url)
11151118
self._next_url = next_url
11161119
except KeyError:
11171120
self._next_url = None

0 commit comments

Comments
 (0)