diff --git a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/servlets/CBStaticServlet.java b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/servlets/CBStaticServlet.java index 55f7cab127..9e21f42b50 100644 --- a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/servlets/CBStaticServlet.java +++ b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/servlets/CBStaticServlet.java @@ -34,7 +34,7 @@ import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import org.eclipse.jetty.ee10.servlet.DefaultServlet; -import org.eclipse.jetty.ee10.servlet.ResourceServlet; +import org.eclipse.jetty.server.ResourceService; import org.jkiss.dbeaver.DBException; import org.jkiss.dbeaver.Log; import org.jkiss.dbeaver.model.auth.SMAuthInfo; @@ -54,6 +54,12 @@ public class CBStaticServlet extends DefaultServlet { private static final Log log = Log.getLog(CBStaticServlet.class); + @Override + public void init() throws ServletException { + super.init(); + this.getResourceService().setWelcomeMode(ResourceService.WelcomeMode.REDIRECT); + } + @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { for (WebServletHandlerDescriptor handler : WebHandlerRegistry.getInstance().getServletHandlers()) { diff --git a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/servlets/ProxyResourceHandler.java b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/servlets/ProxyResourceHandler.java index 414df17e04..63b5d2c851 100644 --- a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/servlets/ProxyResourceHandler.java +++ b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/servlets/ProxyResourceHandler.java @@ -44,9 +44,14 @@ public ProxyResourceHandler(@NotNull Path contentRoot) { public boolean handle(Request request, Response response, Callback callback) throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); String pathInContext = Request.getPathInContext(request); - if (!pathInContext.endsWith("index.html") && !pathInContext.endsWith("sso.html")) { + + if (pathInContext == null || !pathInContext.endsWith("index.html") + && !pathInContext.endsWith("sso.html") + && !pathInContext.endsWith("ssoError.html") + ) { return super.handle(request, response, callback); } + if (pathInContext.startsWith("/")) { pathInContext = pathInContext.substring(1); }