From ca150445c690a97d839b054dbee83a69bd97226f Mon Sep 17 00:00:00 2001 From: Wouter Born Date: Fri, 13 Jan 2023 16:30:22 +0100 Subject: [PATCH] Use UIErrorPageServlet for handling errors Signed-off-by: Wouter Born --- .../src/main/java/org/openhab/ui/internal/UIServlet.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bundles/org.openhab.ui/src/main/java/org/openhab/ui/internal/UIServlet.java b/bundles/org.openhab.ui/src/main/java/org/openhab/ui/internal/UIServlet.java index 3cba6fe882..df6a447dc7 100644 --- a/bundles/org.openhab.ui/src/main/java/org/openhab/ui/internal/UIServlet.java +++ b/bundles/org.openhab.ui/src/main/java/org/openhab/ui/internal/UIServlet.java @@ -109,12 +109,11 @@ public void init() throws UnavailableException { } } else { URL url = defaultHttpContext.getResource(APP_BASE + name); - // if we don't find a resource, and it's not a check for a compressed version, return the app base and let + // if we don't find a resource, and it's not a check for a compressed version, + // let the UIErrorPageServlet return the app base with a proper response code that lets // the Vue.js main UI handle routing if (url == null && Arrays.stream(COMPRESS_EXT).noneMatch(name::endsWith)) { - // sending a directory will trigger "getWelcomeFile" to be called which is required to avoid - // Jetty doing a 302 redirect which breaks Vue.js routing when reloading the browser on some pages - url = defaultHttpContext.getResource(APP_BASE); + return null; } try { logger.debug("getResource bundle file returning {}", url);