Fix previous commit on domain checking of id2url
* the condition on empty self.DOMAIN didn't work * it introduced a regression as subdomains were accepted by the old code
This commit is contained in:
parent
a92063eb12
commit
2c6d5d4e70
1 changed files with 2 additions and 1 deletions
|
|
@ -55,7 +55,8 @@ def id2url(id2url):
|
|||
def inner(self, *args, **kwargs):
|
||||
arg = unicode(args[0])
|
||||
if arg.startswith('http://') or arg.startswith('https://'):
|
||||
if self.DOMAIN and self.DOMAIN == urlsplit(arg).netloc:
|
||||
domain = urlsplit(arg).netloc
|
||||
if not self.DOMAIN or self.DOMAIN == domain or domain.endswith('.'+self.DOMAIN):
|
||||
url = arg
|
||||
else:
|
||||
return None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue