summaryrefslogtreecommitdiff
path: root/internal/api/handlers.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api/handlers.go')
-rw-r--r--internal/api/handlers.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/api/handlers.go b/internal/api/handlers.go
index b837a18..9fcb780 100644
--- a/internal/api/handlers.go
+++ b/internal/api/handlers.go
@@ -100,7 +100,12 @@ func (s *Server) serveFile(w http.ResponseWriter, r *http.Request, filename stri
http.Error(w, "not found", http.StatusNotFound)
return
}
- http.ServeContent(w, r, filename, stat.ModTime(), f.(io.ReadSeeker))
+ rs, ok := f.(io.ReadSeeker)
+ if !ok {
+ http.Error(w, "internal error", http.StatusInternalServerError)
+ return
+ }
+ http.ServeContent(w, r, filename, stat.ModTime(), rs)
}
func (s *Server) serveIndex(w http.ResponseWriter, r *http.Request) {