]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Cast start_line.code to an integer 1568/head
authorChris Seto <chriskseto@gmail.com>
Mon, 26 Oct 2015 05:23:50 +0000 (01:23 -0400)
committerChris Seto <chriskseto@gmail.com>
Mon, 26 Oct 2015 05:23:50 +0000 (01:23 -0400)
Allows use of http.client.HTTPStatus in self.write_status
'%s' % http.client.OK == 'HTTPStatus.OK'
'%d' % http.client.OK == '200'

tornado/http1connection.py

index 1c577063b0036b2010439a110c922d197bd04344..71f0790d457c6a65c89028478d4fc076ff661efa 100644 (file)
@@ -342,7 +342,7 @@ class HTTP1Connection(httputil.HTTPConnection):
                 'Transfer-Encoding' not in headers)
         else:
             self._response_start_line = start_line
-            lines.append(utf8('HTTP/1.1 %s %s' % (start_line[1], start_line[2])))
+            lines.append(utf8('HTTP/1.1 %d %s' % (start_line[1], start_line[2])))
             self._chunking_output = (
                 # TODO: should this use
                 # self._request_start_line.version or