aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAlexander <4nonym0us@xakep.ru>2016-02-25 13:18:24 +0200
committerAlexander <4nonym0us@xakep.ru>2016-02-25 13:18:24 +0200
commit8b17694d807799c1311fd32e38925f9f5fd0c5a1 (patch)
treed3210a76bacd64800f5925ed6b4ed78299a8a93c /src/org/traccar
parent967b513318d4778b7ae5023e48cb544e2e9579a3 (diff)
downloadtraccar-server-8b17694d807799c1311fd32e38925f9f5fd0c5a1.tar.gz
traccar-server-8b17694d807799c1311fd32e38925f9f5fd0c5a1.tar.bz2
traccar-server-8b17694d807799c1311fd32e38925f9f5fd0c5a1.zip
#1751 Bugfix in new API
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/api/CorsResponseFilter.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/org/traccar/api/CorsResponseFilter.java b/src/org/traccar/api/CorsResponseFilter.java
index 001f6ab4c..5e1ff0852 100644
--- a/src/org/traccar/api/CorsResponseFilter.java
+++ b/src/org/traccar/api/CorsResponseFilter.java
@@ -54,7 +54,7 @@ public class CorsResponseFilter implements ContainerResponseFilter {
if (!response.getHeaders().containsKey(ACCESS_CONTROL_ALLOW_ORIGIN_KEY)) {
String origin = request.getHeaderString(HttpHeaders.Names.ORIGIN);
String allowed = Context.getConfig().getString("web.origin");
- if (allowed == null) {
+ if (allowed == null || origin == null) {
response.getHeaders().add(ACCESS_CONTROL_ALLOW_ORIGIN_KEY, ACCESS_CONTROL_ALLOW_ORIGIN_VALUE);
} else if (allowed.contains(origin)) {
String originSafe = URLEncoder.encode(origin, StandardCharsets.UTF_8.name());