From a54b3b04e65cd89e792745cfc778d04feae93058 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Tue, 25 Oct 2022 17:52:28 +0200 Subject: [PATCH] Fix serving of /favicon.ico Signed-off-by: Julien Pivotto --- pkg/react/react.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/react/react.go b/pkg/react/react.go index 782935e..4c09493 100644 --- a/pkg/react/react.go +++ b/pkg/react/react.go @@ -22,6 +22,8 @@ import ( "path" "strings" + "github.com/prometheus/common/server" + ui "github.com/prometheus/promlens/app" ) @@ -68,6 +70,6 @@ func Handle(routePrefix string, externalURL *url.URL) http.HandlerFunc { // For all other paths, serve auxiliary assets. r.URL.Path = strings.TrimPrefix(r.URL.Path, routePrefix) r.URL.Path = path.Join("/build", r.URL.Path) - http.FileServer(ui.Assets).ServeHTTP(w, r) + server.StaticFileServer(ui.Assets).ServeHTTP(w, r) } }