From: Ben Darnell Date: Sun, 16 Mar 2014 03:42:16 +0000 (-0400) Subject: Allow gzip to be used with WSGIApplication. X-Git-Tag: v4.0.0b1~91^2~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f734ddcb01f23b9b35b33299c06b523e86ab967;p=thirdparty%2Ftornado.git Allow gzip to be used with WSGIApplication. Now that transfer encodings have been moved to http1connection, the content-level output transforms can be used with wsgi. --- diff --git a/tornado/test/web_test.py b/tornado/test/web_test.py index 0e741dc6a..81ee890f8 100644 --- a/tornado/test/web_test.py +++ b/tornado/test/web_test.py @@ -1331,6 +1331,7 @@ class ErrorHandlerXSRFTest(WebTestCase): self.assertEqual(response.code, 404) +@wsgi_safe class GzipTestCase(SimpleHandlerTestCase): class Handler(RequestHandler): def get(self): diff --git a/tornado/wsgi.py b/tornado/wsgi.py index ff8170117..8ff8a76e7 100644 --- a/tornado/wsgi.py +++ b/tornado/wsgi.py @@ -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):