Class HttpCompressionHandler

  • All Implemented Interfaces:
    io.vertx.core.Handler<io.vertx.ext.web.RoutingContext>

    public class HttpCompressionHandler
    extends Object
    implements io.vertx.core.Handler<io.vertx.ext.web.RoutingContext>
    A simple wrapping handler that removes the Content-Encoding: identity HTTP header if the Content-Type header is set and the value is a compressed media type as configured via HttpBuildTimeConfig.compressMediaTypes.
    • Constructor Detail

      • HttpCompressionHandler

        public HttpCompressionHandler​(io.vertx.core.Handler<io.vertx.ext.web.RoutingContext> routeHandler,
                                      Set<String> compressedMediaTypes)
    • Method Detail

      • handle

        public void handle​(io.vertx.ext.web.RoutingContext context)
        Specified by:
        handle in interface io.vertx.core.Handler<io.vertx.ext.web.RoutingContext>
      • compressIfNeeded

        public static void compressIfNeeded​(io.vertx.ext.web.RoutingContext context,
                                            Set<String> compressedMediaTypes)