Documentation for pulsar 0.9.2. For development docs, go here.
Response middleware are callable objects which can be used in conjunction with pulsar WsgiHandler. They must return a WsgiResponse which can be the same as the one passed to the callable or a brand new one.
pulsar.apps.wsgi.response.
ResponseMiddleware
[source]¶Base class for response middlewares.
A response middleware is used by a WsgiHandler, it is a callable used to manipulate a WsgiResponse.
The focus of this class is the execute()
method where
the middleware logic is implemented.
available
(environ, response)[source]¶Check if this ResponseMiddleware
can be applied to
the response
object.
Parameters: |
|
---|---|
Returns: |
|
execute
(environ, response)[source]¶Manipulate response, called only if the available()
method returns True
.
pulsar.apps.wsgi.response.
GZipMiddleware
(min_length=200)[source]¶A ResponseMiddleware
for compressing content if the request
allows gzip compression. It sets the Vary header accordingly.
The compression implementation is from http://jython.xhaus.com/http-compression-in-python-and-jython