def is_internal_request(self, domain, referer):
        """
        Returns True if referring URL is the same domain as current request.

        """
        # Different subdomains are treated as different domains.
        return bool(re.match("^https?://%s/" % re.escape(domain), referer))
dataset/ETHPy150Open bitmazk/django-libs/django_libs/middleware.py/CustomBrokenLinkEmailsMiddleware.is_internal_request/original