diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java index 650632b7f38..f30ff4189ca 100644 --- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java @@ -17,6 +17,7 @@ import java.util.HashSet; import java.util.Set; import java.util.StringTokenizer; import java.util.regex.Pattern; +import java.util.zip.Deflater; import java.util.zip.DeflaterOutputStream; import java.util.zip.GZIPOutputStream; @@ -255,7 +256,7 @@ public class GzipFilter extends UserAgentFilter @Override protected DeflaterOutputStream createStream() throws IOException { - return new DeflaterOutputStream(_response.getOutputStream()); + return new DeflaterOutputStream(_response.getOutputStream(),new Deflater(Deflater.DEFAULT_COMPRESSION)); } }; } diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/IncludableGzipFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/IncludableGzipFilter.java index 972393e1644..95de423bc4b 100644 --- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/IncludableGzipFilter.java +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/IncludableGzipFilter.java @@ -18,6 +18,7 @@ import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.UnsupportedEncodingException; +import java.util.zip.Deflater; import java.util.zip.DeflaterOutputStream; import java.util.zip.GZIPOutputStream; @@ -94,7 +95,7 @@ public class IncludableGzipFilter extends GzipFilter @Override protected DeflaterOutputStream createStream() throws IOException { - return new DeflaterOutputStream(_response.getOutputStream()); + return new DeflaterOutputStream(_response.getOutputStream(),new Deflater(Deflater.DEFAULT_COMPRESSION)); } }; }