From 9ac200b719edb379ae76242cf0dffa39b550bfbe Mon Sep 17 00:00:00 2001 From: jedarden Date: Tue, 26 May 2026 20:43:30 -0400 Subject: [PATCH] fix(dashboard): serve embedded pages via io.ReadSeeker (fixes 500 on /fleet) serveEmbeddedFile asserted the embedded file implemented `interface { Len() int64; io.ReadSeeker }`, but *embed.openFile has no Len() method, so http.ServeContent panicked (caught by chi Recoverer -> 500) on every embedded page: /fleet, /ambient, /live, /setup, /simple, /. http.ServeContent only needs an io.ReadSeeker, which embed files satisfy. Co-Authored-By: Claude Opus 4.7 (1M context) --- VERSION | 2 +- mothership/cmd/mothership/main.go | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 485cda6..7fe8a15 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.352 +0.1.353 diff --git a/mothership/cmd/mothership/main.go b/mothership/cmd/mothership/main.go index a333f3c..5fa87ef 100644 --- a/mothership/cmd/mothership/main.go +++ b/mothership/cmd/mothership/main.go @@ -311,10 +311,12 @@ func serveEmbeddedFile(w http.ResponseWriter, r *http.Request, filename string) http.NotFound(w, r) return } - http.ServeContent(w, r, filename, stat.ModTime(), file.(interface { - Len() int64 - io.ReadSeeker - })) + rs, ok := file.(io.ReadSeeker) + if !ok { + http.NotFound(w, r) + return + } + http.ServeContent(w, r, filename, stat.ModTime(), rs) return }