Skip to content

Commit 26a9069

Browse files
committed
fix: set the original base url when found change in next url
1 parent 98bdb98 commit 26a9069

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

gitlab/client.py

+3
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

@@ -1130,6 +1131,8 @@ def _query(
11301131
next_url = requests.utils.parse_header_links(result.headers["links"])[
11311132
0
11321133
]["url"]
1134+
if not next_url.startswith(self._gl._base_url):
1135+
next_url = re.sub(r"^.*?/api", f"{self._gl._base_url}/api", next_url)
11331136
self._next_url = next_url
11341137
except KeyError:
11351138
self._next_url = None

0 commit comments

Comments
 (0)