Fix static file serving with correct MIME types
- Correct embed file path construction in staticFileHandler - Static files now served with proper Content-Type headers - CSS files: text/css, JS files: text/javascript, SVG files: image/svg+xml - Resolves browser MIME type mismatch errors 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
df0ead2657
commit
704d0d2305
1 changed files with 1 additions and 1 deletions
|
|
@ -204,7 +204,7 @@ func (s *Server) broadcastToWebSocketClients(message WebSocketMessage) {
|
||||||
|
|
||||||
func (s *Server) staticFileHandler() http.Handler {
|
func (s *Server) staticFileHandler() http.Handler {
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
filePath := "static" + r.URL.Path
|
filePath := "static/" + r.URL.Path
|
||||||
|
|
||||||
data, err := s.staticFiles.ReadFile(filePath)
|
data, err := s.staticFiles.ReadFile(filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue