From 29c4688659577ffa12698dadef7de47dd784a5f3 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 19 Jan 1998 22:25:24 +0000 Subject: Patch by Tim O'Malley for servers that send a response looking just like HTTP/1.x 200 instead of HTTP/1.x 200 OK --- Lib/httplib.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Lib/httplib.py b/Lib/httplib.py index 7081bd1..05289b3 100644 --- a/Lib/httplib.py +++ b/Lib/httplib.py @@ -123,8 +123,12 @@ class HTTP: try: [ver, code, msg] = string.split(line, None, 2) except ValueError: - self.headers = None - return -1, line, self.headers + try: + [ver, code] = string.split(line, None, 1) + msg = "" + except ValueError: + self.headers = None + return -1, line, self.headers if ver[:5] != 'HTTP/': self.headers = None return -1, line, self.headers -- cgit v0.12