From 66bf1c23df6aba5478b530e89c61208fb1630c70 Mon Sep 17 00:00:00 2001 From: TwinProduction Date: Sat, 21 Nov 2020 17:53:26 -0500 Subject: [PATCH] Minor updates --- main.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 5f2e57d5..e3cfd931 100644 --- a/main.go +++ b/main.go @@ -29,8 +29,7 @@ func main() { if cfg.Security != nil && cfg.Security.IsValid() { resultsHandler = security.Handler(serviceResultsHandler, cfg.Security) } - // favicon needs to be always served from the root - http.HandleFunc("/favicon.ico", favIconHandler) + http.HandleFunc("/favicon.ico", favIconHandler) // favicon needs to be always served from the root http.HandleFunc(cfg.Web.PrependWithContextRoot("/api/v1/results"), resultsHandler) http.HandleFunc(cfg.Web.PrependWithContextRoot("/health"), healthHandler) http.Handle(cfg.Web.ContextRoot, GzipHandler(http.StripPrefix(cfg.Web.ContextRoot, http.FileServer(http.Dir("./static"))))) @@ -92,7 +91,7 @@ func healthHandler(writer http.ResponseWriter, _ *http.Request) { _, _ = writer.Write([]byte("{\"status\":\"UP\"}")) } -// favIconHanlder responds to /favicon.ico requests +// favIconHandler handles requests for /favicon.ico func favIconHandler(writer http.ResponseWriter, request *http.Request) { http.ServeFile(writer, request, "./static/favicon.ico") }