From bf48cb639c00cfb55ff8cd7454aa3628f30eae3e Mon Sep 17 00:00:00 2001 From: Shalin Shekhar Mangar Date: Tue, 1 Dec 2015 13:23:08 +0000 Subject: [PATCH] SOLR-7339: Use GzipHandler instead of GzipFilter git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1717431 13f79535-47bb-0310-9956-ffa450edef68 --- .../solr/client/solrj/embedded/JettySolrRunner.java | 10 ++++++++++ 1 file changed, 10 insertions(+) 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); } /**