feat: allow optional HTTP protocol for self-hosted GitLab instances (#9757)

Co-authored-by: Rohit Malhotra <rohitvinodmalhotra@gmail.com>
This commit is contained in:
Yumi Izumi 2025-08-05 03:54:19 +09:00 committed by GitHub
parent 4e5e2a7095
commit 402b6224a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -56,8 +56,15 @@ class GitLabService(BaseGitService, GitService):
self.token = token
if base_domain:
self.BASE_URL = f'https://{base_domain}/api/v4'
self.GRAPHQL_URL = f'https://{base_domain}/api/graphql'
# Check if protocol is already included
if base_domain.startswith(('http://', 'https://')):
# Use the provided protocol
self.BASE_URL = f'{base_domain}/api/v4'
self.GRAPHQL_URL = f'{base_domain}/api/graphql'
else:
# Default to https if no protocol specified
self.BASE_URL = f'https://{base_domain}/api/v4'
self.GRAPHQL_URL = f'https://{base_domain}/api/graphql'
@property
def provider(self) -> str: