Skip to content

Commit 7e70a5c

Browse files
committed
httplib - minor update to check empty response
1 parent 9c29f86 commit 7e70a5c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/http/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ def _read_chunked(self, amt):
563563
# a vanishingly small number of sites EOF without
564564
# sending the trailer
565565
break
566-
if line == b"\r\n":
566+
if line in (b'\r\n', b'\n', b''):
567567
break
568568

569569
# we read everything; close the "file"
@@ -718,7 +718,7 @@ def _tunnel(self):
718718
if not line:
719719
# for sites which EOF without sending a trailer
720720
break
721-
if line == b'\r\n':
721+
if line in (b'\r\n', b'\n', b''):
722722
break
723723

724724
def connect(self):

0 commit comments

Comments
 (0)