From d0097c2e548a294c665c7fba7a1c6b409ab8b076 Mon Sep 17 00:00:00 2001 From: Sunny Date: Thu, 1 Dec 2022 13:34:13 +0000 Subject: [PATCH] fileserver: Use new ServeMux Fileserver should use its own ServeMux. Signed-off-by: Sunny --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 9aec36b20..24c6705af 100644 --- a/main.go +++ b/main.go @@ -345,8 +345,9 @@ func main() { func startFileServer(path string, address string, l logr.Logger) { l.Info("starting file server") fs := http.FileServer(http.Dir(path)) - http.Handle("/", fs) - err := http.ListenAndServe(address, nil) + mux := http.NewServeMux() + mux.Handle("/", fs) + err := http.ListenAndServe(address, mux) if err != nil { l.Error(err, "file server error") }