httplib - minor update to check empty response

This commit is contained in:
Senthil Kumaran 2012-04-29 10:39:49 +08:00
parent 9c29f86a81
commit 7e70a5c169

View file

@ -563,7 +563,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
# we read everything; close the "file" # we read everything; close the "file"
@ -718,7 +718,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):