]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fixed example in doc string 1222/head
authorLukas Rist <glaslos@gmail.com>
Mon, 13 Oct 2014 12:06:02 +0000 (14:06 +0200)
committerLukas Rist <glaslos@gmail.com>
Mon, 13 Oct 2014 12:06:02 +0000 (14:06 +0200)
We have to pass a HTTPHeaders object to write_headers()

tornado/httpserver.py

index 05d0e186c31e789a8df547ff14e7af787b637bbe..d4c990caa329b9db284f14995d2286e96e5d3d80 100644 (file)
@@ -56,7 +56,7 @@ class HTTPServer(TCPServer, httputil.HTTPServerConnectionDelegate):
            message = "You requested %s\n" % request.uri
            request.connection.write_headers(
                httputil.ResponseStartLine('HTTP/1.1', 200, 'OK'),
-               {"Content-Length": str(len(message))})
+               httputil.HTTPHeaders({"Content-Length": str(len(message))}))
            request.connection.write(message)
            request.connection.finish()