mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-02 03:44:43 +00:00
add unquoted redirectino url to info
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@1980 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
1166804eb0
commit
265f942ba1
1 changed files with 8 additions and 5 deletions
|
|
@ -228,12 +228,15 @@ class HttpUrl (urlbase.UrlBase, proxysupport.ProxySupport):
|
|||
tries < self.max_redirects:
|
||||
newurl = self.headers.getheader("Location",
|
||||
self.headers.getheader("Uri", ""))
|
||||
redirected, is_idn = linkcheck.url.url_norm(
|
||||
urlparse.urljoin(redirected, newurl))
|
||||
if not isinstance(redirected, unicode):
|
||||
redirected = unicode(redirected, "iso8859-1", "ignore")
|
||||
self.add_info(_("Redirected to %(url)s") % {'url': redirected})
|
||||
# make new url absolute and unicode
|
||||
newurl = urlparse.urljoin(redirected, newurl)
|
||||
if not isinstance(newurl, unicode):
|
||||
newurl = unicode(newurl, "iso8859-1", "ignore")
|
||||
linkcheck.log.debug(linkcheck.LOG_CHECK, "Redirected to %r",
|
||||
newurl)
|
||||
self.add_info(_("Redirected to %(url)s") % {'url': redirected})
|
||||
redirected, is_idn = linkcheck.url.url_norm(newurl)
|
||||
linkcheck.log.debug(linkcheck.LOG_CHECK, "Norm redirected to %r",
|
||||
redirected)
|
||||
# see about recursive redirect
|
||||
all_seen = self.aliases + [self.cache_url_key]
|
||||
|
|
|
|||
Loading…
Reference in a new issue