]> granicus.if.org Git - python/commitdiff
3.2 - Fix for Issue13684 - httplib tunnel infinite loop
authorSenthil Kumaran <senthil@uthcode.com>
Mon, 23 Apr 2012 15:50:07 +0000 (23:50 +0800)
committerSenthil Kumaran <senthil@uthcode.com>
Mon, 23 Apr 2012 15:50:07 +0000 (23:50 +0800)
Lib/http/client.py

index 745b999942bc9935f4a539ef77a8d5999f0d96ca..6828f146a7c353afc2002a3303589ae6c013a258 100644 (file)
@@ -715,6 +715,9 @@ class HTTPConnection:
             line = response.fp.readline(_MAXLINE + 1)
             if len(line) > _MAXLINE:
                 raise LineTooLong("header line")
+            if not line:
+                # for sites which EOF without sending a trailer
+                break
             if line == b'\r\n':
                 break