aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/web
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/web')
-rw-r--r--src/main/java/org/traccar/web/WebServer.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/web/WebServer.java b/src/main/java/org/traccar/web/WebServer.java
index 704a4b3cd..62ac338eb 100644
--- a/src/main/java/org/traccar/web/WebServer.java
+++ b/src/main/java/org/traccar/web/WebServer.java
@@ -106,7 +106,8 @@ public class WebServer implements LifecycleObject {
protected void handleErrorPage(
HttpServletRequest request, Writer writer, int code, String message) throws IOException {
Path index = Paths.get(config.getString(Keys.WEB_PATH), "index.html");
- if (code == HttpStatus.NOT_FOUND_404 && Files.exists(index)) {
+ if (code == HttpStatus.NOT_FOUND_404
+ && !request.getPathInfo().startsWith("/api/") && Files.exists(index)) {
writer.write(Files.readString(index));
} else {
writer.write("<!DOCTYPE><html><head><title>Error</title></head><html><body>"