Skip to content

Commit f712783

Browse files
committed
fix: set the original base url when found change in next url
1 parent e409811 commit f712783

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

@@ -1110,6 +1111,8 @@ def _query(
11101111
next_url = requests.utils.parse_header_links(result.headers["links"])[
11111112
0
11121113
]["url"]
1114+
if not next_url.startswith(self._gl._base_url):
1115+
next_url = re.sub(r"^.*?/api", f"{self._gl._base_url}/api", next_url)
11131116
self._next_url = next_url
11141117
except KeyError:
11151118
self._next_url = None

0 commit comments

Comments
 (0)