pub fn auto(
    method: &Method,
    headers: &HeaderMap<HeaderValue>,
    resp: Response<Body>
) -> Result<Response<Body>>
Available on crate feature compression only.
Expand description

Create a wrapping handler that compresses the Body of a Response using gzip, deflate, brotli or zstd if is specified in the Accept-Encoding header, adding content-encoding: <coding> to the Response’s HeaderMap It also provides the ability to apply compression for text-based MIME types only.