aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/Context.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java
index 62396d740..2cd1beecc 100644
--- a/src/org/traccar/Context.java
+++ b/src/org/traccar/Context.java
@@ -21,6 +21,7 @@ import java.net.InetAddress;
import java.util.Properties;
import org.apache.velocity.app.VelocityEngine;
+import org.eclipse.jetty.util.URIUtil;
import org.traccar.database.AliasesManager;
import org.traccar.database.ConnectionManager;
import org.traccar.database.DataManager;
@@ -259,8 +260,8 @@ public final class Context {
"org.apache.velocity.runtime.log.NullLogChute");
String address = config.getString("web.address", InetAddress.getLocalHost().getHostAddress());
- String port = config.getString("web.port", "8082");
- String webUrl = "http://" + address + ":" + port + "/";
+ int port = config.getInteger("web.port", 8082);
+ String webUrl = URIUtil.newURI("http", address, port, "", "");
webUrl = Context.getConfig().getString("web.url", webUrl);
velocityProperties.setProperty("web.url", webUrl);