def _get_host_regex(self, allowed_domains, allow_subdomains):
        if not allowed_domains:
            return re.compile('')  # allow all by default
        domains = [d.replace('.', r'\.') for d in allowed_domains]
        if allow_subdomains:
            regex = r'(.*\.)?(%s)$' % '|'.join(domains)
        else:
            regex = r'(%s)$' % '|'.join(domains)
        return re.compile(regex, re.IGNORECASE)
Override this method to implement a different offsite policy
dataset/ETHPy150Open scrapinghub/splash/splash/request_middleware.py/AllowedDomainsMiddleware._get_host_regex