minor change to offsite middleware regex, for clarity (doesn't change behaviour)

This commit is contained in:
Pablo Hoffman 2009-08-19 16:16:34 -03:00
parent f3c6d83ad3
commit 1d351c2866
1 changed files with 1 additions and 1 deletions

View File

@ -31,7 +31,7 @@ class OffsiteMiddleware(object):
def get_host_regex(self, domains):
"""Override this method to implement a different offsite policy"""
domains = [d.replace('.', r'\.') for d in domains]
regex = r'^(|.*\.)(%s)$' % '|'.join(domains)
regex = r'^(.*\.)?(%s)$' % '|'.join(domains)
return re.compile(regex)
def domain_opened(self, spider):