diff --git a/lib/http.go b/lib/http.go index f2d4371..c8051b6 100644 --- a/lib/http.go +++ b/lib/http.go @@ -19,6 +19,7 @@ import ( "log/slog" "maps" "net/http" + "net/http/pprof" "path" "path/filepath" "strconv" @@ -327,6 +328,13 @@ func (state *State) setupRoutes() error { state.Mux.HandleFunc("/", state.handleRequest) + if state.Settings.Debug { + http.HandleFunc(state.UrlPath+"/debug/pprof/", pprof.Index) + http.HandleFunc(state.UrlPath+"/debug/pprof/profile", pprof.Profile) + http.HandleFunc(state.UrlPath+"/debug/pprof/symbol", pprof.Symbol) + http.HandleFunc(state.UrlPath+"/debug/pprof/trace", pprof.Trace) + } + state.Mux.Handle("GET "+state.UrlPath+"/assets/", http.StripPrefix(state.UrlPath, gzipped.FileServer(gzipped.FS(embed.AssetsFs)))) for _, c := range state.Challenges {