Fix for Issue13684 - httplib tunnel infinite loop

This commit is contained in:
Senthil Kumaran 2012-04-23 23:46:46 +08:00
parent eda1959d07
commit 0267185088
1 changed files with 5 additions and 1 deletions

View File

@ -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):