Close HTTP connections without body content. Github issue #376

This commit is contained in:
Bastian Kleineidam 2013-01-23 19:42:29 +01:00
parent a86e36e5d3
commit 707b7b7db1
2 changed files with 6 additions and 0 deletions

View file

@ -16,6 +16,9 @@ Fixes:
Closes: GH bug #369
- checking: Catch UnicodeError from idna.encode() fixing an internal error when
trying to connect to certain invalid hostnames.
- checking: Always close HTTP connections without body content.
See also http://bugs.python.org/issue16298
Closes: GH bug #376
8.3 "Mahna Mahna Killer" (released 6.1.2013)

View file

@ -569,6 +569,9 @@ class HTTPResponse:
self.length -= len(s)
if not self.length:
self.close()
else:
if not s:
self.close()
return s
def _read_chunked(self, amt):