mirror of
https://github.com/python/cpython.git
synced 2025-08-28 20:56:54 +00:00
httplib - minor update to check empty response
This commit is contained in:
commit
150c365430
1 changed files with 2 additions and 2 deletions
|
@ -557,7 +557,7 @@ class HTTPResponse(io.RawIOBase):
|
||||||
# a vanishingly small number of sites EOF without
|
# a vanishingly small number of sites EOF without
|
||||||
# sending the trailer
|
# sending the trailer
|
||||||
break
|
break
|
||||||
if line == b"\r\n":
|
if line in (b'\r\n', b'\n', b''):
|
||||||
break
|
break
|
||||||
|
|
||||||
def _readall_chunked(self):
|
def _readall_chunked(self):
|
||||||
|
@ -789,7 +789,7 @@ class HTTPConnection:
|
||||||
if not line:
|
if not line:
|
||||||
# for sites which EOF without sending a trailer
|
# for sites which EOF without sending a trailer
|
||||||
break
|
break
|
||||||
if line == b'\r\n':
|
if line in (b'\r\n', b'\n', b''):
|
||||||
break
|
break
|
||||||
|
|
||||||
def connect(self):
|
def connect(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue