diff --git a/openhands/integrations/gitlab/gitlab_service.py b/openhands/integrations/gitlab/gitlab_service.py index 34916da404..a681f36279 100644 --- a/openhands/integrations/gitlab/gitlab_service.py +++ b/openhands/integrations/gitlab/gitlab_service.py @@ -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: