mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-06-20 04:44:12 -04:00
avoid exception in case of url without host part
This commit is contained in:
parent
332912acd7
commit
f30c143c66
2 changed files with 9 additions and 5 deletions
|
@ -54,11 +54,15 @@ class Url:
|
||||||
return self._host
|
return self._host
|
||||||
|
|
||||||
def matches_ip_or_domain(self, ip_or_domain):
|
def matches_ip_or_domain(self, ip_or_domain):
|
||||||
"""Returns true if
|
|
||||||
- ip_or_domain is an ip address and self.host is the same ip address
|
|
||||||
- ip_or_domain is a domain and self.host is the same domain
|
|
||||||
- ip_or_domain is a domain and self.host is a subdomain of it
|
|
||||||
"""
|
"""
|
||||||
|
Returns true if
|
||||||
|
- ip_or_domain is an ip address and self.host is the same ip address
|
||||||
|
- ip_or_domain is a domain and self.host is the same domain
|
||||||
|
- ip_or_domain is a domain and self.host is a subdomain of it
|
||||||
|
"""
|
||||||
|
if not self.host:
|
||||||
|
return False
|
||||||
|
|
||||||
if ip_or_domain == self.host:
|
if ip_or_domain == self.host:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -32,7 +32,7 @@ def find_package_data(package):
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name='brozzler',
|
name='brozzler',
|
||||||
version='1.1b7.dev107',
|
version='1.1b7.dev108',
|
||||||
description='Distributed web crawling with browsers',
|
description='Distributed web crawling with browsers',
|
||||||
url='https://github.com/internetarchive/brozzler',
|
url='https://github.com/internetarchive/brozzler',
|
||||||
author='Noah Levitt',
|
author='Noah Levitt',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue