mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #16298: In HTTPResponse.read(), close the socket when there is no Content-Length and the incoming stream is finished.
Patch by Eran Rundstein.
This commit is contained in:
parent
e0035a212b
commit
084daa2f74
4 changed files with 23 additions and 1 deletions
|
@ -511,6 +511,10 @@ class HTTPResponse(io.RawIOBase):
|
|||
self.length -= len(s)
|
||||
if not self.length:
|
||||
self.close()
|
||||
else:
|
||||
if not s:
|
||||
self.close()
|
||||
|
||||
return s
|
||||
|
||||
def _read_chunked(self, amt):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue