From 559e1d23b9a98abac45ae8fac626c61182fe911c Mon Sep 17 00:00:00 2001 From: Ole-Morten Duesund Date: Sat, 23 Aug 2025 23:57:32 +0200 Subject: [PATCH] Fix MIME type handling for static files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fixed static file path construction in staticFileHandler - Removed duplicate 'static' prefix that was causing incorrect file paths - Now properly serves CSS and JS files with correct MIME types - Resolves browser security errors from MIME type mismatches 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- internal/server/server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/server/server.go b/internal/server/server.go index ed90f4e..d47d1e7 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -410,7 +410,8 @@ func (s *Server) handleFavicon(w http.ResponseWriter, r *http.Request) { func (s *Server) staticFileHandler() http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - filePath := "static" + r.URL.Path + // Remove /static/ prefix from URL path to get the actual file path + filePath := "static" + r.URL.Path[len("/static"):] data, err := s.staticFiles.ReadFile(filePath) if err != nil {