fix: Add no-cache header on HTML and favicon handler to prevent 404
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
51529e4dad
commit
86e0df4250
6
main.go
6
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")
|
||||
|
|
|
|||
Loading…
Reference in New Issue