summaryrefslogtreecommitdiff
path: root/src/leap/util/web.py
blob: 6ddf4b21356029ef5a63d40cde68e2fcb5b9e17d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""
web related utilities
"""


def get_https_domain_and_port(full_domain):
    """
    returns a tuple with domain and port
    from a full_domain string that can
    contain a colon
    """
    domain_split = full_domain.split(':')
    _len = len(domain_split)
    if _len == 1:
        domain, port = full_domain, 443
    if _len == 2:
        domain, port = domain_split
    return domain, port