Improved redirection warning text.

This commit is contained in:
Bastian Kleineidam 2010-10-27 09:15:46 +02:00
parent d9e981e497
commit b2cf40151f

View file

@ -388,16 +388,16 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport):
return -1, response
# in case of changed scheme make new URL object
if self.urlparts[0] != self.scheme:
if set_result:
self.add_warning(
_("Redirection to different URL type encountered; "
"the original URL was `%(url)s'.") %
{"url": self.url},
tag=WARN_HTTP_WRONG_REDIRECT)
newobj = get_url_from(
redirected, self.recursion_level, self.aggregate,
parent_url=self.parent_url, base_ref=self.base_ref,
line=self.line, column=self.column, name=self.name)
if set_result:
self.add_warning(
_("Redirection to URL `%(newurl)s' with different scheme"
" found; the original URL was `%(url)s'.") %
{"url": self.url, "newurl": newobj.url},
tag=WARN_HTTP_WRONG_REDIRECT)
# append new object to queue
self.aggregate.urlqueue.put(newobj)
# pretend to be finished and logged