aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorjcardus <joaquim.cardeira@gmail.com>2020-03-25 19:09:42 +0000
committerjcardus <joaquim.cardeira@gmail.com>2020-03-25 19:09:42 +0000
commit37810b5062a4b5ea7e1b92800186c03a5817471f (patch)
tree2d19fd9079dcee3eae566707c0157bd59863ccb7 /src/main
parentfeac85bad4004fb3e316a88285626e12840398d2 (diff)
downloadtrackermap-server-37810b5062a4b5ea7e1b92800186c03a5817471f.tar.gz
trackermap-server-37810b5062a4b5ea7e1b92800186c03a5817471f.tar.bz2
trackermap-server-37810b5062a4b5ea7e1b92800186c03a5817471f.zip
compression on jetty
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/web/WebServer.java5
1 files changed, 4 insertions, 1 deletions
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) {