Complete Beast format implementation with enhanced features and fixes #19
1 changed files with 2 additions and 1 deletions
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>
commit
559e1d23b9
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue