match on http scheme if no match is found will assume http

def parse_http_scheme(uri):
    """
    match on http scheme if no match is found will assume http
    """
    regex = re.compile(
        r'^(?:http)s?://',
        flags=re.IGNORECASE
    )
    match = regex.match(uri)

    return match.group(0) if match else 'http://'