Esempio n. 1
0
    def _reject_self_redirect(self, wbrequest, cdx, status_headers):
        if status_headers.statusline.startswith('3'):
            request_url = wbrequest.wb_url.url.lower()
            location_url = status_headers.get_header('Location').lower()

            #TODO: canonicalize before testing?
            if (UrlRewriter.strip_protocol(request_url) == UrlRewriter.strip_protocol(location_url)):
                raise wbexceptions.CaptureException('Self Redirect: ' + str(cdx))