From 455dd5a6505c3d075c5f5ee950e8f48ec7458e8c Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 29 Sep 2015 13:20:33 +1300 Subject: Add more CORS headers (fix #1434) --- src/org/traccar/web/BaseServlet.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/org/traccar/web') diff --git a/src/org/traccar/web/BaseServlet.java b/src/org/traccar/web/BaseServlet.java index 9b6964623..97432e9fd 100644 --- a/src/org/traccar/web/BaseServlet.java +++ b/src/org/traccar/web/BaseServlet.java @@ -42,6 +42,8 @@ public abstract class BaseServlet extends HttpServlet { resp.setContentType("application/json"); resp.setCharacterEncoding("UTF-8"); resp.setHeader("Access-Control-Allow-Origin", "*"); + resp.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); + resp.setHeader("Access-Control-Allow-Methods", "GET, POST"); if (!handle(command, req, resp)) { resp.sendError(HttpServletResponse.SC_BAD_REQUEST); } -- cgit v1.2.3