diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-15 09:34:21 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-15 09:34:21 +1300 |
commit | 132e70273ec3ad4b193f759dda8e3a7420bbbeab (patch) | |
tree | c65465490aab47f784f8a927ca5a31b41d6cd73d /src/org | |
parent | 12693f823d17e106361c9626d14d9baf040af7e4 (diff) | |
download | traccar-server-132e70273ec3ad4b193f759dda8e3a7420bbbeab.tar.gz traccar-server-132e70273ec3ad4b193f759dda8e3a7420bbbeab.tar.bz2 traccar-server-132e70273ec3ad4b193f759dda8e3a7420bbbeab.zip |
Config parameter for allow origin (fix #1526)
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/web/BaseServlet.java | 3 |
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)) { |