aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-11-15 09:34:21 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-11-15 09:34:21 +1300
commit132e70273ec3ad4b193f759dda8e3a7420bbbeab (patch)
treec65465490aab47f784f8a927ca5a31b41d6cd73d /src/org/traccar/web
parent12693f823d17e106361c9626d14d9baf040af7e4 (diff)
downloadtrackermap-server-132e70273ec3ad4b193f759dda8e3a7420bbbeab.tar.gz
trackermap-server-132e70273ec3ad4b193f759dda8e3a7420bbbeab.tar.bz2
trackermap-server-132e70273ec3ad4b193f759dda8e3a7420bbbeab.zip
Config parameter for allow origin (fix #1526)
Diffstat (limited to 'src/org/traccar/web')
-rw-r--r--src/org/traccar/web/BaseServlet.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/traccar/web/BaseServlet.java b/src/org/traccar/web/BaseServlet.java
index 54cd10ad8..c3506693f 100644
--- a/src/org/traccar/web/BaseServlet.java
+++ b/src/org/traccar/web/BaseServlet.java
@@ -53,7 +53,8 @@ public abstract class BaseServlet extends HttpServlet {
try {
resp.setContentType(APPLICATION_JSON);
resp.setCharacterEncoding(CharsetUtil.UTF_8.name());
- resp.setHeader(HttpHeaders.Names.ACCESS_CONTROL_ALLOW_ORIGIN, ALLOW_ORIGIN_VALUE);
+ resp.setHeader(HttpHeaders.Names.ACCESS_CONTROL_ALLOW_ORIGIN,
+ Context.getConfig().getString("web.origin", ALLOW_ORIGIN_VALUE));
resp.setHeader(HttpHeaders.Names.ACCESS_CONTROL_ALLOW_HEADERS, ALLOW_HEADERS_VALUE);
resp.setHeader(HttpHeaders.Names.ACCESS_CONTROL_ALLOW_METHODS, ALLOW_METHODS_VALUE);
if (!handle(getCommand(req), req, resp)) {