From 317ef181f06a2a2fa356e5fdebaab9ea6524095f Mon Sep 17 00:00:00 2001 From: calvin Date: Wed, 20 Jul 2005 08:53:57 +0000 Subject: [PATCH] handle all redirections to different URL schemes, not just HTTP -> not HTTP, and fix a variable typo git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@2780 e7d03fd6-7b0d-0410-9947-9c21f3af8025 --- linkcheck/checker/httpurl.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/linkcheck/checker/httpurl.py b/linkcheck/checker/httpurl.py index a2b7ef9e..470134d2 100644 --- a/linkcheck/checker/httpurl.py +++ b/linkcheck/checker/httpurl.py @@ -348,12 +348,12 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport): # check cache again on the changed URL if self.consumer.checked_redirect(redirected, self): return -1, response - # check if we still have a http url, it could be another - # scheme, eg https or news - if self.urlparts[0] != "http": + # check if we still have the same scheme type, it could be a + # different one + if self.urlparts[0] != self.scheme: self.add_warning( - _("HTTP redirection to non-http url encountered; " - "the original url was %r.") % self.url, + _("Redirection to different URL type encountered; " + "the original URL was %r.") % self.url, tag="http-wrong-redirect") # make new Url object newobj = linkcheck.checker.get_url_from( @@ -361,7 +361,7 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport): parent_url=self.parent_url, base_ref=self.base_ref, line=self.line, column=self.column, name=self.name, cmdline=False) - newobj.warning = self.warning + newobj.warnings = self.warnings newobj.info = self.info # append new object to queue self.consumer.append_url(newobj)