diff --git a/Lib/http/client.py b/Lib/http/client.py index eb857c03ca7..9c110d5a045 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -557,7 +557,7 @@ class HTTPResponse(io.RawIOBase): # a vanishingly small number of sites EOF without # sending the trailer break - if line == b"\r\n": + if line in (b'\r\n', b'\n', b''): break def _readall_chunked(self): @@ -789,7 +789,7 @@ class HTTPConnection: if not line: # for sites which EOF without sending a trailer break - if line == b'\r\n': + if line in (b'\r\n', b'\n', b''): break def connect(self):