mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-04-20 07:45:50 -04:00
avoid exception in case of url without host part
This commit is contained in:
parent
332912acd7
commit
f30c143c66
@ -54,11 +54,15 @@ class Url:
|
||||
return self._host
|
||||
|
||||
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:
|
||||
return True
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user