InflateFilter
The main task of the InflateFilter is to decompress the content of an HTTP message body. It uses the .zlib
library to perform this job.
ch::nevis::isiweb4::filter::inflate::InflateFilter
libInflateFilter.so.1
+PRUNE_ACCEPT_ENCODING
Configuration
BuffSize
Type: Integer
Usage Constraint: optional, min: 1024
Default: 8196
Defines the buffer size for the uncompressed data.
InflateRequest
Type: Boolean
Usage Constraint: optional
Default: false
Enables decompression of HTTP requests.
InflateResponse
Type: Boolean
Usage Constraint: optional
Default: true
Enables decompression of HTTP responses.
InflateResponse.ContentTypes
Type: String
Usage Constraint: optional
This parameter is only evaluated if InflateResponse
is true
.
It defines a newline or space separated list of content-types that will be uncompressed and permits configuration of mime types. The response will be uncompressed only, if its mime type is contained in the configured list. If this parameter is not set then all responses will be decompressed.
Example configuration
The InflateFilter
has three configurable parameters. Through the InflateRequest
/InflateResponse
parameters, you can decompress the request or the response, respectively. Use the BuffSize
parameter to set the size of the buffer (default is 8196
, minimum is 1024
). In the following example, the inflate filter InflateRequestFilter
decompresses the content of the incoming request body if the value of the Content-Encoding
header is gzip
or deflate
. Because here we want to decompress the request body, the parameter InflateRequest
is set to true
. Also, the InflateResponse
parameter is set to false
to turn off the response body inflation.
<filter>
<filter-name>InflateRequestFilter</filter-name>
<filter-class>ch::nevis::isiweb4::filter::inflate::InflateFilter</filter-class>
<init-param>
<param-name>BuffSize</param-name>
<param-value>10000</param-value>
</init-param>
<init-param>
<param-name>InflateRequest</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>InflateResponse</param-name>
<param-value>false</param-value>
</init-param>
</filter>
The InflateFilter.example
can be also be found in the installed nevisProxy package, in directory /opt/nevisproxy/examples/various/.