Skip to content

Commit a3e54f7

Browse files
committed
fix: set the original base url when found change in next url
1 parent 1136b17 commit a3e54f7

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

@@ -1132,6 +1133,8 @@ def _query(
11321133
next_url = requests.utils.parse_header_links(result.headers["links"])[
11331134
0
11341135
]["url"]
1136+
if not next_url.startswith(self._gl._base_url):
1137+
next_url = re.sub(r"^.*?/api", f"{self._gl._base_url}/api", next_url)
11351138
self._next_url = next_url
11361139
except KeyError:
11371140
self._next_url = None

0 commit comments

Comments
 (0)