avoid stack trace in case of urls without host

This commit is contained in:
Noah Levitt 2017-03-02 15:23:50 -08:00
parent 842bfd651c
commit f30160d8ee
2 changed files with 3 additions and 1 deletions

View File

@ -51,7 +51,7 @@ except:
setuptools.setup(
name='warcprox',
version='2.1b1.dev53',
version='2.1b1.dev54',
description='WARC writing MITM HTTP/S proxy',
url='https://github.com/internetarchive/warcprox',
author='Noah Levitt',

View File

@ -98,6 +98,8 @@ def host_matches_ip_or_domain(host, ip_or_domain):
- ip_or_domain is a domain and host is the same domain
- ip_or_domain is a domain and host is a subdomain of it
'''
if not host:
return False
_host = normalize_host(host)
_ip_or_domain = normalize_host(ip_or_domain)