Reset content type setting after loading HTTP headers.

This commit is contained in:
Bastian Kleineidam 2011-05-28 17:59:44 +02:00
parent 123d62b1f4
commit 5515645af6
2 changed files with 3 additions and 0 deletions

View file

@ -3,6 +3,7 @@
Fixes:
- checking: HTML parser detects and handles stray "<" characters before
end tags.
- checking: Reset content type setting after loading HTTP headers again.
7.0 "Plots with a View" (released 28.5.2011)

View file

@ -560,6 +560,7 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport):
response = self.url_connection.getresponse(True)
self.timeout = headers.http_timeout(response)
self.headers = response.msg
self.content_type = None
self.persistent = not response.will_close
if self.persistent and self.method == "HEAD":
# Some servers send page content after a HEAD request,
@ -623,6 +624,7 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport):
response = self._try_http_response()
response = self.follow_redirections(response, set_result=False)[1]
self.headers = response.msg
self.content_type = None
# Re-read size info, since the GET request result could be different
# than a former HEAD request.
self.add_size_info()