Home > unfiltered-gzip

unfiltered-gzip

Unfiltered-gzip is a project mainly written in ..., based on the MIT license.

GZip support for Unfiltered, a toolkit for servicing HTTP in Scala

This is a GZip utility for Unfiltered (https://github.com/n8han/Unfiltered).

It offers a GZip intent you can use like this:

object Echo extends unfiltered.filter.Plan { def intent = GZipIntent { case Path(Seg(p :: Nil)) => ResponseString(p) } }

Additionally, GZipReponseString can be used as a replacement for ResponseString, like this:

object Echo extends unfiltered.filter.Plan { def intent = { case req @ Path(Seg(p :: Nil)) => GZipResponseString(req, p) } }

Client's AcceptEncoding headers will always be respected, and Content-Encoding headers will be automatically sent.