print redirection info

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@1544 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2004-08-27 15:32:40 +00:00
parent 25f8f13a06
commit 8e8eba71dc

View file

@ -153,7 +153,6 @@ class HttpUrl (urlbase.UrlBase, proxysupport.ProxySupport):
response = self._get_http_response()
self.headers = response.msg
self.proxy, self.proxyauth = oldproxy
linkcheck.log.debug(linkcheck.LOG_CHECK, "follow all redirections")
tries, response = \
self.follow_redirections(response, redirect_cache)
if tries == -1:
@ -212,6 +211,7 @@ class HttpUrl (urlbase.UrlBase, proxysupport.ProxySupport):
def follow_redirections (self, response, redirect_cache):
"""follow all redirections of http response"""
linkcheck.log.debug(linkcheck.LOG_CHECK, "follow all redirections")
redirected = self.url
tries = 0
while response.status in [301, 302] and self.headers and \
@ -220,6 +220,7 @@ class HttpUrl (urlbase.UrlBase, proxysupport.ProxySupport):
self.headers.getheader("Uri", ""))
redirected = linkcheck.url.url_norm(
urlparse.urljoin(redirected, newurl))
self.add_info(_("Redirected to %(url)s") % {'url': redirected})
linkcheck.log.debug(linkcheck.LOG_CHECK, "Redirected to %r",
redirected)
# note: urlparts has to be a list