From 9f260a60ea2dfbc7cc45db98d15a116b74e10d01 Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Sun, 17 May 2026 14:02:08 +0200 Subject: [PATCH] fix(service): /favicon.ico now serves from the embedded web bundle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The /favicon.ico route was redirecting r.URL.Path to "/media/favicon-braille.svg" and calling HandleMedia. HandleMedia strips "/media" and serves from the embedded static/media/ subtree — which does not contain a favicon. The actual asset lives under the embedded web/img/ subtree (see the `web/img/favicon-braille*` embed directive in handlers_media.go). Repoint to "/web/img/favicon-braille.svg" + HandleWeb. http.FileServer inside HandleWeb finds the file at its native embed path and serves it with the right Content-Type. Pre-existing bug exposed by Stockholm because that frontend triggers a /favicon.ico request from every loaded page; without this fix the browser fills the console with a 404 on every Stockholm view. Co-Authored-By: Claude Opus 4.7 (1M context) --- cmd/soundtouch-service/main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/soundtouch-service/main.go b/cmd/soundtouch-service/main.go index f0958f6..2eac068 100644 --- a/cmd/soundtouch-service/main.go +++ b/cmd/soundtouch-service/main.go @@ -912,8 +912,11 @@ func setupRouter(server *handlers.Server, stockholmHandler *stockholm.Handler) * // reach it without a reboot. r.Post("/setup/peer-probe/{deviceId}", server.HandlePeerProbe) r.Get("/favicon.ico", func(w http.ResponseWriter, r *http.Request) { - r.URL.Path = "/media/favicon-braille.svg" - server.HandleMedia()(w, r) + // The favicon lives in the embedded web/img bundle, not under + // static/media — HandleMedia would 404. HandleWeb serves from + // webFS at its native path. + r.URL.Path = "/web/img/favicon-braille.svg" + server.HandleWeb()(w, r) }) r.Get("/media/*", server.HandleMedia())