We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ca8297 commit 1b4d4dcCopy full SHA for 1b4d4dc
1 file changed
ymir/tools/privileged/gitlab.py
@@ -40,7 +40,8 @@
40
41
42
_GITLAB_COMMIT_RE = re.compile(r"^/(.+?)/-/commit/([0-9a-f]+)\.(?:patch|diff)$", re.IGNORECASE)
43
-_REDHAT_PATH_PREFIX = "/redhat/"
+_REDHAT_WEB_PREFIX = "/redhat/"
44
+_REDHAT_API_PREFIX = "/api/v4/projects/redhat%2F"
45
46
47
def _has_mock_url_rewrites() -> bool:
@@ -61,7 +62,9 @@ def _is_private_gitlab(url: str) -> bool:
61
62
hostname = parsed.hostname or ""
63
if hostname == "gitlab.cee.redhat.com":
64
return True
- return hostname == "gitlab.com" and parsed.path.startswith(_REDHAT_PATH_PREFIX)
65
+ if hostname != "gitlab.com":
66
+ return False
67
+ return parsed.path.startswith(_REDHAT_WEB_PREFIX) or parsed.path.startswith(_REDHAT_API_PREFIX)
68
69
70
def _get_api_diff_url(url: str) -> str:
0 commit comments