summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Lib/httplib.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py
index 13629c4a96..5d16e53c4c 100644
--- a/Lib/httplib.py
+++ b/Lib/httplib.py
@@ -748,7 +748,11 @@ class HTTPConnection:
line = response.fp.readline(_MAXLINE + 1)
if len(line) > _MAXLINE:
raise LineTooLong("header line")
- if line == '\r\n': break
+ if not line:
+ # for sites which EOF without sending trailer
+ break
+ if line == '\r\n':
+ break
def connect(self):