def check_whitelist(request_host, whitelist):
 if (':' not in request_host):
  request_host = (request_host + ':80')
 if (request_host in whitelist):
  return True
 return any((match_host(request_host, host) for host in whitelist))

def check_whitelist ( request_host , whitelist ) : if ( ':' not in request_host ) : request_host = ( request_host + ':80' ) if ( request_host in whitelist ) : return True return any ( ( match_host ( request_host , host ) for host in whitelist ) )
check a given request host against a whitelist .