Merge pull request #972 from fluxcd/fs-new-servemux

fileserver: Use new ServeMux
This commit is contained in:
Paulo Gomes 2022-12-01 14:05:40 +00:00 committed by GitHub
commit aad4060461
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -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")
}