From bfd936ab717c6d4e4e50bbd0f797c3d1fc7eda42 Mon Sep 17 00:00:00 2001 From: xengineering <me@xengineering.eu> Date: Thu, 15 Feb 2024 20:18:19 +0100 Subject: view: Add HTTP 204 handler for /favicon.ico Otherwise e.g. the Firefox browser throws an error on the console. --- main.go | 1 + 1 file changed, 1 insertion(+) (limited to 'main.go') diff --git a/main.go b/main.go index 2f398b3..ec811c9 100644 --- a/main.go +++ b/main.go @@ -45,6 +45,7 @@ func startServer(addr string) *http.Server { Handler(http.StripPrefix("/static/", http.FileServer(http.FS(static)))) r.HandleFunc("/recipes", view.Recipes).Methods(`GET`) r.HandleFunc("/recipe/{id:[0-9]+}", view.Recipe).Methods(`GET`) + r.HandleFunc("/favicon.ico", view.Favicon).Methods(`GET`) r.HandleFunc("/", view.Index).Methods(`GET`) muxer := http.NewServeMux() -- cgit v1.2.3-70-g09d2