diff --git a/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.java b/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.java index bbaf9f94cdc..bf7a8970c7e 100644 --- a/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.java +++ b/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.java @@ -49,6 +49,7 @@ import org.eclipse.jetty.server.SecureRequestCustomizer; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.SslConnectionFactory; +import org.eclipse.jetty.server.handler.gzip.GzipHandler; import org.eclipse.jetty.server.session.HashSessionIdManager; import org.eclipse.jetty.servlet.BaseHolder; import org.eclipse.jetty.servlet.FilterHolder; @@ -350,7 +351,16 @@ public class JettySolrRunner { // for some reason, there must be a servlet for this to get applied root.addServlet(Servlet404.class, "/*"); + GzipHandler gzipHandler = new GzipHandler(); + gzipHandler.setHandler(root); + gzipHandler.setMinGzipSize(2048); + gzipHandler.setCheckGzExists(false); + gzipHandler.setCompressionLevel(-1); + gzipHandler.setExcludedAgentPatterns(".*MSIE.6\\.0.*"); + gzipHandler.setIncludedMethods("GET"); + + server.setHandler(gzipHandler); } /**