From 86e0df4250f634028466037cbcb53de34c03e401 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Tue, 7 Apr 2026 15:15:06 -0400 Subject: [PATCH] fix: Add no-cache header on HTML and favicon handler to prevent 404 Co-Authored-By: Claude Opus 4.6 --- main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.go b/main.go index 7a5dfa7..b97eeb1 100644 --- a/main.go +++ b/main.go @@ -54,6 +54,7 @@ func main() { } data, _ := fs.ReadFile(webFS, "web/index.html") w.Header().Set("Content-Type", "text/html; charset=utf-8") + w.Header().Set("Cache-Control", "no-cache, must-revalidate") w.Write(data) }) @@ -71,6 +72,11 @@ func main() { mux.HandleFunc("POST /f/{id}/auth", h.AuthSubmit) mux.HandleFunc("DELETE /f/{id}", h.Delete) + // Favicon (prevent 404) + mux.HandleFunc("GET /favicon.ico", func(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(http.StatusNoContent) + }) + // Health mux.HandleFunc("GET /health", func(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "application/json")