(urlstr: str)
return url
raises WrapException if not whitelisted subdomain
raises WrapException if not whitelisted subdomain
raises WrapException if not whitelisted subdomain
def whitelist_wrapdb(urlstr: str) -> urllib.parse.ParseResult:
    """ raises WrapException if not whitelisted subdomain """
    url = urllib.parse.urlparse(urlstr)
    if not url.hostname:
        raise WrapException(f'{urlstr} is not a valid URL')
    if not url.hostname.endswith(WHITELIST_SUBDOMAIN):
        raise WrapException(f'{urlstr} is not a whitelisted WrapDB URL')
    if has_ssl and not url.scheme == 'https':
        raise WrapException(f'WrapDB did not have expected SSL https url, instead got {urlstr}')
    return url
def whitelist_wrapdb ( urlstr : str ) -> urllib . parse . ParseResult : url = urllib . parse . urlparse ( urlstr ) if not url . hostname : raise WrapException ( f'{urlstr} is not a valid URL' ) if not url . hostname . endswith ( WHITELIST_SUBDOMAIN ) : raise WrapException ( f'{urlstr} is not a whitelisted WrapDB URL' ) if has_ssl and not url . scheme == 'https' : raise WrapException ( f'WrapDB did not have expected SSL https url, instead got {urlstr}' ) return url