From dae45986f678ddc5f7a2df97fddfc0e1d5886794 Mon Sep 17 00:00:00 2001 From: ston1th Date: Sat, 3 Aug 2019 23:38:17 +0200 Subject: [PATCH] added favicon 404 --- testapp/api/main.go | 3 +++ testapp/db/main.go | 3 +++ testapp/srv/main.go | 3 +++ 3 files changed, 9 insertions(+) diff --git a/testapp/api/main.go b/testapp/api/main.go index 29c508f..58f2f38 100644 --- a/testapp/api/main.go +++ b/testapp/api/main.go @@ -53,6 +53,9 @@ func main() { log.Printf("%s %s %s", r.RemoteAddr, r.Method, r.URL) fmt.Fprintf(w, "api: ok") }) + http.HandleFunc("/favicon.ico", func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotFound) + }) s := &http.Server{ ReadTimeout: 5 * time.Second, WriteTimeout: 10 * time.Second, diff --git a/testapp/db/main.go b/testapp/db/main.go index 9892b68..d6c8c56 100644 --- a/testapp/db/main.go +++ b/testapp/db/main.go @@ -49,6 +49,9 @@ func main() { log.Printf("%s %s %s", r.RemoteAddr, r.Method, r.URL) fmt.Fprintf(w, "db: ok") }) + http.HandleFunc("/favicon.ico", func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotFound) + }) s := &http.Server{ ReadTimeout: 5 * time.Second, WriteTimeout: 10 * time.Second, diff --git a/testapp/srv/main.go b/testapp/srv/main.go index 25ec417..1b3d940 100644 --- a/testapp/srv/main.go +++ b/testapp/srv/main.go @@ -63,6 +63,9 @@ func main() { dbUrl, dbBody, apiUrl, apiBody) }) + http.HandleFunc("/favicon.ico", func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusNotFound) + }) s := &http.Server{ ReadTimeout: 5 * time.Second, WriteTimeout: 10 * time.Second,