From 3d606dc971820b86fa88d177fe352c31fc25e66c Mon Sep 17 00:00:00 2001 From: Mickael Kerjean Date: Mon, 9 Oct 2023 07:50:03 +0200 Subject: [PATCH] fix (admin): bug in admin --- server/ctrl/static.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/server/ctrl/static.go b/server/ctrl/static.go index 6b50aca46..79dde8b64 100644 --- a/server/ctrl/static.go +++ b/server/ctrl/static.go @@ -126,12 +126,11 @@ func LegacyServeFile(res http.ResponseWriter, req *http.Request, filePath string func ServeBackofficeHandler(ctx *App, res http.ResponseWriter, req *http.Request) { url := req.URL.Path - if url != URL_SETUP && Config.Get("auth.admin").String() == "" { - http.Redirect(res, req, URL_SETUP, http.StatusTemporaryRedirect) - return - } - if filepath.Ext(filepath.Base(url)) == "" { + if url != URL_SETUP && Config.Get("auth.admin").String() == "" { + http.Redirect(res, req, URL_SETUP, http.StatusTemporaryRedirect) + return + } ServeFile(res, req, WWWPublic, "index.backoffice.html") return }