aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/WebDataHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/WebDataHandler.java')
-rw-r--r--src/main/java/org/traccar/WebDataHandler.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/WebDataHandler.java b/src/main/java/org/traccar/WebDataHandler.java
index 858b00aad..1af1af48a 100644
--- a/src/main/java/org/traccar/WebDataHandler.java
+++ b/src/main/java/org/traccar/WebDataHandler.java
@@ -67,6 +67,7 @@ public class WebDataHandler extends BaseDataHandler {
private final String url;
private final String header;
private final boolean json;
+ private final boolean jsonUrlVariables;
private final boolean retryEnabled;
private final int retryDelay;
@@ -85,6 +86,7 @@ public class WebDataHandler extends BaseDataHandler {
this.url = config.getString(Keys.FORWARD_URL);
this.header = config.getString(Keys.FORWARD_HEADER);
this.json = config.getBoolean(Keys.FORWARD_JSON);
+ this.jsonUrlVariables = config.getBoolean(Keys.FORWARD_JSON_URL_VARIABLES);
this.retryEnabled = config.getBoolean(Keys.FORWARD_RETRY_ENABLE);
this.retryDelay = config.getInteger(Keys.FORWARD_RETRY_DELAY, 100);
@@ -192,7 +194,7 @@ public class WebDataHandler extends BaseDataHandler {
String formattedUrl;
try {
- formattedUrl = formatRequest(position);
+ formattedUrl = (json && !jsonUrlVariables) ? url : formatRequest(position);
} catch (UnsupportedEncodingException | JsonProcessingException e) {
throw new RuntimeException("Forwarding formatting error", e);
}