use of org.eclipse.jetty.server.handler.gzip.GzipHandler in project async-http-client by AsyncHttpClient.
the class EofTerminatedTest method configureHandler.
@Override
public AbstractHandler configureHandler() throws Exception {
GzipHandler gzipHandler = new GzipHandler();
gzipHandler.setHandler(new StreamHandler());
return gzipHandler;
}
use of org.eclipse.jetty.server.handler.gzip.GzipHandler in project druid by druid-io.
the class JettyServerInitUtils method wrapWithDefaultGzipHandler.
public static GzipHandler wrapWithDefaultGzipHandler(final Handler handler) {
GzipHandler gzipHandler = new GzipHandler();
gzipHandler.setMinGzipSize(0);
gzipHandler.setIncludedMethods(GZIP_METHODS);
// We don't actually have any precomputed .gz resources, and checking for them inside jars is expensive.
gzipHandler.setCheckGzExists(false);
gzipHandler.setHandler(handler);
return gzipHandler;
}
use of org.eclipse.jetty.server.handler.gzip.GzipHandler in project jetty.project by eclipse.
the class ServletContextHandlerTest method testGzipHandlerSet.
@Test
public void testGzipHandlerSet() throws Exception {
ServletContextHandler context = new ServletContextHandler();
context.setSessionHandler(new SessionHandler());
context.setGzipHandler(new GzipHandler());
GzipHandler gzip = context.getGzipHandler();
_server.start();
assertEquals(context.getSessionHandler(), context.getHandler());
assertEquals(gzip, context.getSessionHandler().getHandler());
assertEquals(context.getServletHandler(), gzip.getHandler());
}
use of org.eclipse.jetty.server.handler.gzip.GzipHandler in project jetty.project by eclipse.
the class GzipHandlerTest method testAddGetPaths.
@Test
public void testAddGetPaths() {
GzipHandler gzip = new GzipHandler();
gzip.addIncludedPaths("/foo");
gzip.addIncludedPaths("^/bar.*$");
String[] includedPaths = gzip.getIncludedPaths();
assertThat("Included Paths.size", includedPaths.length, is(2));
assertThat("Included Paths", Arrays.asList(includedPaths), contains("/foo", "^/bar.*$"));
}
use of org.eclipse.jetty.server.handler.gzip.GzipHandler in project spring-boot by spring-projects.
the class JettyServletWebServerFactory method createGzipHandler.
private HandlerWrapper createGzipHandler() {
GzipHandler handler = new GzipHandler();
Compression compression = getCompression();
handler.setMinGzipSize(compression.getMinResponseSize());
handler.setIncludedMimeTypes(compression.getMimeTypes());
if (compression.getExcludedUserAgents() != null) {
handler.setExcludedAgentPatterns(compression.getExcludedUserAgents());
}
return handler;
}
Aggregations