From d51d32726ce35db6b37510aa50cdbfca360b564a Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Sat, 27 Sep 2025 22:16:23 -0400 Subject: [PATCH] fix(lib): serve CSS properly (#1158) Signed-off-by: Xe Iaso --- lib/http.go | 4 ++++ xess/xess.go | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/http.go b/lib/http.go index dcefdb0..0f63ba7 100644 --- a/lib/http.go +++ b/lib/http.go @@ -17,6 +17,7 @@ import ( "github.com/TecharoHQ/anubis/lib/localization" "github.com/TecharoHQ/anubis/lib/policy" "github.com/TecharoHQ/anubis/web" + "github.com/TecharoHQ/anubis/xess" "github.com/a-h/templ" "github.com/golang-jwt/jwt/v5" "golang.org/x/net/publicsuffix" @@ -282,6 +283,9 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { if strings.HasPrefix(r.URL.Path, anubis.BasePrefix+anubis.StaticPath) { s.mux.ServeHTTP(w, r) return + } else if strings.HasPrefix(r.URL.Path, anubis.BasePrefix+xess.BasePrefix) { + s.mux.ServeHTTP(w, r) + return } s.maybeReverseProxyOrPage(w, r) diff --git a/xess/xess.go b/xess/xess.go index efdd5bc..a391c63 100644 --- a/xess/xess.go +++ b/xess/xess.go @@ -16,7 +16,8 @@ var ( //go:embed *.css static Static embed.FS - URL = "/.within.website/x/xess/xess.css" + BasePrefix = "/.within.website/x/xess/" + URL = "/.within.website/x/xess/xess.css" ) func init() {