]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Allow gzip to be used with WSGIApplication.
authorBen Darnell <ben@bendarnell.com>
Sun, 16 Mar 2014 03:42:16 +0000 (23:42 -0400)
committerBen Darnell <ben@bendarnell.com>
Sun, 16 Mar 2014 03:42:16 +0000 (23:42 -0400)
Now that transfer encodings have been moved to http1connection,
the content-level output transforms can be used with wsgi.

tornado/test/web_test.py
tornado/wsgi.py

index 0e741dc6a6695efa3c792cfbca8fe0bf747f7547..81ee890f8e35a9b4114722c52d79b8e5b433a7cd 100644 (file)
@@ -1331,6 +1331,7 @@ class ErrorHandlerXSRFTest(WebTestCase):
         self.assertEqual(response.code, 404)
 
 
+@wsgi_safe
 class GzipTestCase(SimpleHandlerTestCase):
     class Handler(RequestHandler):
         def get(self):
index ff8170117b7fd0c3e25f964fc00ea9de449e87ce..8ff8a76e7529f5ec467111689e688b4c125b2602 100644 (file)
@@ -80,13 +80,8 @@ class WSGIApplication(web.Application):
 
        Use a regular `.Application` and wrap it in `WSGIAdapter` instead.
     """
-    def __init__(self, handlers=None, default_host="", **settings):
-        web.Application.__init__(self, handlers, default_host, transforms=[],
-                                 **settings)
-        self._adapter = WSGIAdapter(self)
-
     def __call__(self, environ, start_response):
-        return self._adapter.__call__(environ, start_response)
+        return WSGIAdapter(self)(environ, start_response)
 
 
 class _WSGIConnection(object):