follow redirections when getting HTTP contents

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3473 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2006-09-21 09:27:38 +00:00
parent a25f32d32b
commit 1883b79303
2 changed files with 7 additions and 0 deletions

View file

@ -4,6 +4,12 @@
Type: bugfix
Changed: linkcheck/robotparser2.py
* Don't rely on HTTP HEAD requests to generate the same response status
as HTTP GET. So we have to follow redirections when using HTTP GET to
get page contents.
Type: bugfix
Changed: linkcheck/checker/httpurl.py
4.4 "Garden State" (released 16.9.2006)
* The JavaScript URL syntax check allows now digits and underscores.

View file

@ -543,6 +543,7 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport):
self.close_connection()
t = time.time()
response = self._get_http_response()
tries, response = self.follow_redirections(response)
self.headers = response.msg
self.data = response.read()
encoding = headers.get_content_encoding(self.headers)