Search in sources :

Example 11 with ContentEncodingRepository

use of io.undertow.server.handlers.encoding.ContentEncodingRepository in project core-ng-project by neowu.

the class HTTPServer method handler.

private HttpHandler handler() {
    HTTPServerIOHandler handler = new HTTPServerIOHandler(this.handler);
    if (!gzip)
        return handler;
    GZipPredicate predicate = new GZipPredicate();
    return new EncodingHandler(new ContentEncodingRepository().addEncodingHandler("gzip", new GzipEncodingProvider(), 100, predicate).addEncodingHandler("deflate", new DeflateEncodingProvider(), 10, predicate)).setNext(handler);
}
Also used : DeflateEncodingProvider(io.undertow.server.handlers.encoding.DeflateEncodingProvider) ContentEncodingRepository(io.undertow.server.handlers.encoding.ContentEncodingRepository) EncodingHandler(io.undertow.server.handlers.encoding.EncodingHandler) GzipEncodingProvider(io.undertow.server.handlers.encoding.GzipEncodingProvider)

Aggregations

ContentEncodingRepository (io.undertow.server.handlers.encoding.ContentEncodingRepository)11 EncodingHandler (io.undertow.server.handlers.encoding.EncodingHandler)10 GzipEncodingProvider (io.undertow.server.handlers.encoding.GzipEncodingProvider)9 DeflateEncodingProvider (io.undertow.server.handlers.encoding.DeflateEncodingProvider)5 Undertow (io.undertow.Undertow)3 PathHandler (io.undertow.server.handlers.PathHandler)3 IOException (java.io.IOException)3 UndertowOptions (io.undertow.UndertowOptions)2 HttpServerExchange (io.undertow.server.HttpServerExchange)2 PathResourceManager (io.undertow.server.handlers.resource.PathResourceManager)2 ResourceHandler (io.undertow.server.handlers.resource.ResourceHandler)2 DeploymentInfo (io.undertow.servlet.api.DeploymentInfo)2 TestHttpClient (io.undertow.testutils.TestHttpClient)2 AtomicReference (java.util.concurrent.atomic.AtomicReference)2 HttpGet (org.apache.http.client.methods.HttpGet)2 Test (org.junit.Test)2 Preconditions (com.google.common.base.Preconditions)1 Metrics (io.micrometer.core.instrument.Metrics)1 Tags (io.micrometer.core.instrument.Tags)1 Builder (io.undertow.Undertow.Builder)1