Complete Beast format implementation with enhanced features and fixes #19

Merged
olemd merged 38 commits from beast-format-refactor into main 2025-08-24 20:50:38 +02:00
Showing only changes of commit 559e1d23b9 - Show all commits

Fix MIME type handling for static files

- 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 <noreply@anthropic.com>
Ole-Morten Duesund 2025-08-23 23:57:32 +02:00

View file

@ -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 {