From 4d0efce2e00543f36f4f0a7a023d60fdb928a8fc Mon Sep 17 00:00:00 2001 From: ari melody Date: Thu, 3 Sep 2026 19:49:04 +0100 Subject: [PATCH] fix global static files not being served correctly --- cmd/stream-tools/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/stream-tools/main.go b/cmd/stream-tools/main.go index 9b5ce96..3551529 100644 --- a/cmd/stream-tools/main.go +++ b/cmd/stream-tools/main.go @@ -6,7 +6,6 @@ import ( "log" "net/http" "os/signal" - "strings" "syscall" "codeberg.org/arimelody/ari-stream-tools/config" @@ -73,7 +72,8 @@ func main() { public := srv.Group("/public") public.GET("/*path", func(ctx *gin.Context) { - filepath := strings.TrimPrefix(ctx.Request.URL.Path, "/public/") + filepath := ctx.Request.URL.Path + log.Printf("serving %s from static FS...", filepath) http.ServeFileFS(ctx.Writer, ctx.Request, static.PublicFS, filepath) })