mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-30 12:40:33 +00:00
Detect redirection errors when getting content.
This commit is contained in:
parent
5f2e6730a9
commit
e8da486d66
1 changed files with 4 additions and 1 deletions
|
|
@ -222,6 +222,7 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport, pooledc
|
|||
self.set_result(_("more than %d redirections, aborting") %
|
||||
self.max_redirects, valid=False)
|
||||
self.close_response()
|
||||
self.do_check_content = False
|
||||
return
|
||||
if self.do_fallback(self.response.status):
|
||||
self.fallback_to_get()
|
||||
|
|
@ -672,7 +673,9 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport, pooledc
|
|||
if self.method != "GET" or self.response is None:
|
||||
self.method = "GET"
|
||||
self._try_http_response()
|
||||
self.follow_redirections(set_result=False)
|
||||
num = self.follow_redirections(set_result=False)
|
||||
if not (0 <= num <= self.max_redirects):
|
||||
raise LinkCheckerError(_("Redirection error"))
|
||||
# Re-read size info, since the GET request result could be different
|
||||
# than a former HEAD request.
|
||||
self.add_size_info()
|
||||
|
|
|
|||
Loading…
Reference in a new issue