Returns a GZIP handler. @param wac web application context @return handler
(final WebAppContext wac)
| 242 | * @return handler |
| 243 | */ |
| 244 | private static Supplier<Handler> gzip(final WebAppContext wac) { |
| 245 | return () -> { |
| 246 | final CompressionHandler ch = new CompressionHandler(); |
| 247 | final GzipCompression gc = new GzipCompression(); |
| 248 | ch.putCompression(gc); |
| 249 | final CompressionConfig cc = CompressionConfig.builder().defaults(). |
| 250 | compressIncludeMethod("PUT").decompressIncludeMethod("PUT").build(); |
| 251 | ch.putConfiguration("/", cc); |
| 252 | ch.setHandler(wac); |
| 253 | return ch; |
| 254 | }; |
| 255 | } |
| 256 | |
| 257 | @Override |
| 258 | protected void parseArgs() throws IOException { |