]> granicus.if.org Git - python/commitdiff
httplib - minor update to check empty response
authorSenthil Kumaran <senthil@uthcode.com>
Sun, 29 Apr 2012 02:39:49 +0000 (10:39 +0800)
committerSenthil Kumaran <senthil@uthcode.com>
Sun, 29 Apr 2012 02:39:49 +0000 (10:39 +0800)
Lib/http/client.py

index 6828f146a7c353afc2002a3303589ae6c013a258..d226f63ac4ad52f40d59aa3af66690889e1d0e1f 100644 (file)
@@ -563,7 +563,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
 
         # we read everything; close the "file"
@@ -718,7 +718,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):