From 7f98299b733ea06d9f1e9841001362ca39c01538 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Mon, 25 Feb 2019 16:59:33 +0200 Subject: [PATCH] Added check for httprof_path --- utils/server.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/server.go b/utils/server.go index d6699d34b..0359b5c19 100644 --- a/utils/server.go +++ b/utils/server.go @@ -203,6 +203,9 @@ func handleRequest(w http.ResponseWriter, r *http.Request) { } func (s *Server) RegisterProfiler(addr string) { + if addr[len(addr)-1] != '/' { + addr = addr + "/" + } s.httpMux.HandleFunc(addr, pprof.Index) s.httpMux.HandleFunc(addr+"cmdline", pprof.Cmdline) s.httpMux.HandleFunc(addr+"profile", pprof.Profile)