]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Tolerate servers that don't include reason text in the status line.
authorBen Darnell <ben@bendarnell.com>
Sun, 15 May 2011 03:21:05 +0000 (20:21 -0700)
committerBen Darnell <ben@bendarnell.com>
Sun, 15 May 2011 03:21:05 +0000 (20:21 -0700)
tornado/simple_httpclient.py

index 2efe7e4455ec7c29616058a55a9b9be6e1a39052..19645e324f3d0f28a18819d43057d84849c8ae5f 100644 (file)
@@ -254,7 +254,7 @@ class _HTTPConnection(object):
     def _on_headers(self, data):
         data = data.decode("latin1")
         first_line, _, header_data = data.partition("\r\n")
-        match = re.match("HTTP/1.[01] ([0-9]+) .*", first_line)
+        match = re.match("HTTP/1.[01] ([0-9]+)", first_line)
         assert match
         self.code = int(match.group(1))
         self.headers = HTTPHeaders.parse(header_data)