From ed7e73b5af4e4e84f3abd2dde73626f90de911bb Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 1 Dec 2015 10:43:42 +1300 Subject: Explicitly register REST filters --- src/org/traccar/web/WebServer.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/org/traccar/web') diff --git a/src/org/traccar/web/WebServer.java b/src/org/traccar/web/WebServer.java index 2318c4151..675f4d489 100644 --- a/src/org/traccar/web/WebServer.java +++ b/src/org/traccar/web/WebServer.java @@ -27,6 +27,8 @@ import org.eclipse.jetty.webapp.WebAppContext; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.servlet.ServletContainer; import org.traccar.Config; +import org.traccar.api.CORSResponseFilter; +import org.traccar.api.SecurityRequestFilter; import org.traccar.helper.Log; /** @@ -131,6 +133,8 @@ public class WebServer { private void initRestApi() { ResourceConfig resourceConfig = new ResourceConfig(); resourceConfig.packages("org.traccar.api"); + resourceConfig.register(SecurityRequestFilter.class); + resourceConfig.register(CORSResponseFilter.class); ServletContextHandler servletHandler = new ServletContextHandler(ServletContextHandler.NO_SESSIONS); ServletHolder servletHolder = new ServletHolder(new ServletContainer(resourceConfig)); servletHandler.addServlet(servletHolder, "/rest/*"); -- cgit v1.2.3