From e98f0edb56f3d2355adf83a79edcc8ec2fa65a18 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 7 May 2026 00:41:45 +0300 Subject: Fix static file read seeker guard for s0 --- internal/api/handlers.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'internal/api/handlers.go') 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) { -- cgit v1.2.3