From 37810b5062a4b5ea7e1b92800186c03a5817471f Mon Sep 17 00:00:00 2001 From: jcardus Date: Wed, 25 Mar 2020 19:09:42 +0000 Subject: compression on jetty --- src/main/java/org/traccar/web/WebServer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/java/org/traccar/web') diff --git a/src/main/java/org/traccar/web/WebServer.java b/src/main/java/org/traccar/web/WebServer.java index 70fef4ed3..daa46b926 100644 --- a/src/main/java/org/traccar/web/WebServer.java +++ b/src/main/java/org/traccar/web/WebServer.java @@ -22,6 +22,7 @@ import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.ErrorHandler; import org.eclipse.jetty.server.handler.HandlerList; +import org.eclipse.jetty.server.handler.gzip.GzipHandler; import org.eclipse.jetty.servlet.DefaultServlet; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; @@ -97,7 +98,9 @@ public class WebServer { HandlerList handlers = new HandlerList(); initClientProxy(config, handlers); handlers.addHandler(servletHandler); - server.setHandler(handlers); + GzipHandler gzipHandler = new GzipHandler(); + gzipHandler.setHandler(handlers); + server.setHandler(gzipHandler); } private void initClientProxy(Config config, HandlerList handlers) { -- cgit v1.2.3 From faa35f608eff1225d35794d0a38398897940d802 Mon Sep 17 00:00:00 2001 From: jcardus Date: Wed, 25 Mar 2020 21:33:35 +0000 Subject: compression on jetty --- src/main/java/org/traccar/web/WebServer.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/java/org/traccar/web') diff --git a/src/main/java/org/traccar/web/WebServer.java b/src/main/java/org/traccar/web/WebServer.java index daa46b926..92548d218 100644 --- a/src/main/java/org/traccar/web/WebServer.java +++ b/src/main/java/org/traccar/web/WebServer.java @@ -95,12 +95,13 @@ public class WebServer { } }); + GzipHandler gzipHandler = new GzipHandler(); + HandlerList handlers = new HandlerList(); initClientProxy(config, handlers); handlers.addHandler(servletHandler); - GzipHandler gzipHandler = new GzipHandler(); - gzipHandler.setHandler(handlers); - server.setHandler(gzipHandler); + handlers.addHandler(gzipHandler); + server.setHandler(handlers); } private void initClientProxy(Config config, HandlerList handlers) { -- cgit v1.2.3 From 02b79df2316d2b463a74edc7a1dc08231b0121f7 Mon Sep 17 00:00:00 2001 From: jcardus Date: Wed, 25 Mar 2020 21:38:53 +0000 Subject: compression on jetty --- src/main/java/org/traccar/web/WebServer.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/main/java/org/traccar/web') diff --git a/src/main/java/org/traccar/web/WebServer.java b/src/main/java/org/traccar/web/WebServer.java index 92548d218..d5c4cf71b 100644 --- a/src/main/java/org/traccar/web/WebServer.java +++ b/src/main/java/org/traccar/web/WebServer.java @@ -95,12 +95,10 @@ public class WebServer { } }); - GzipHandler gzipHandler = new GzipHandler(); - HandlerList handlers = new HandlerList(); initClientProxy(config, handlers); handlers.addHandler(servletHandler); - handlers.addHandler(gzipHandler); + handlers.addHandler(new GzipHandler()); server.setHandler(handlers); } -- cgit v1.2.3