Skip to content

Commit

Permalink
Merge pull request #972 from fluxcd/fs-new-servemux
Browse files Browse the repository at this point in the history
fileserver: Use new ServeMux
  • Loading branch information
Paulo Gomes authored Dec 1, 2022
2 parents 04d87b6 + d0097c2 commit aad4060
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit aad4060

Please sign in to comment.