1
0
mirror of synced 2025-12-30 03:02:21 -05:00
Files
airbyte/airbyte-integrations/connectors/source-gitlab/source_gitlab/utils.py
Denys Davydov ba773ce4ce 🐛 Source Gitlab: disallow http in cloud, disallow endpoints in URLs (#27346)
* Connector health: source hubspot, gitlab, snapchat-marketing: fix builds

* #26254 source Gitlab: disallow enpoints in URLs, disallow bare http in cloud

* source gitlab: update changelog

* #26254 source gitlab: rm http from spec
2023-06-15 11:11:54 +03:00

21 lines
456 B
Python

#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
from typing import Tuple
def parse_url(url: str) -> Tuple[bool, str, str]:
parts = url.split("://")
if len(parts) > 1:
scheme, url = parts
else:
scheme = "https"
if scheme not in ("http", "https"):
return False, "", ""
parts = url.split("/", 1)
if len(parts) > 1:
return False, "", ""
host, *_ = parts
return True, scheme, host