@samitouri / QOSami-HFS / commits / a0eb42be

fix: frontend interface shouldn't be sent accessing /~/frontend/

Massimo Melina committed Apr 9, 2026 at 09:55 UTC a0eb42be5598039eb6af1d691db35c1c556f3af6
1 file changed +1 -1
src/serveGuiAndSharedFiles.ts
+1 -1
@@ -43,7 +43,7 @@ export const guiFilesMiddleware: Koa.Middleware = async (ctx, next) => {
43 return try_(() => r && new URL(r).pathname?.startsWith(ADMIN_URI)) ? serveAdminFiles(ctx, next)
44 : serveFrontendFiles(ctx, next)
45 }
46 - if (path.startsWith(FRONTEND_URI))
46 + if (path.startsWith(FRONTEND_URI) && !path.endsWith('/'))
47 return serveFrontendPrefixed(ctx, next)
48 if (path.length === ADMIN_URI.length - 1 && ADMIN_URI.startsWith(path))
49 return ctx.redirect(ctx.state.revProxyPath + ADMIN_URI)