Skip to content

Instantly share code, notes, and snippets.

@agemooij
Created October 20, 2012 16:32
Show Gist options
  • Save agemooij/3923858 to your computer and use it in GitHub Desktop.
Save agemooij/3923858 to your computer and use it in GitHub Desktop.
SprayAdaptiveGzipSupport
trait SprayAdaptiveGzipSupport extends directives.EncodingDirectives {
import spray.httpx.encoding._
def withAdaptiveCompressionSupport: Directive0 =
(decodeRequest(NoEncoding) | decodeRequest(Gzip) | decodeRequest(Deflate)) &
(encodeResponse(NoEncoding) | encodeResponse(Gzip) | encodeResponse(Deflate))
}
object SprayAdaptiveGzipSupport extends SprayAdaptiveGzipSupport
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment