Makes sure that debug endpoints are always available, which will aid in debugging demon issues. Wraps debug endpoints in the middleware chain so the can be blocked by authz. Signed-off-by: Brian Goff <cpuguy83@gmail.com> Upstream-commit: 408c7ade7008ca9b2181e12e51a01250a7a94413 Component: engine
14 lines
255 B
Go
14 lines
255 B
Go
package debug
|
|
|
|
import (
|
|
"net/http"
|
|
"net/http/pprof"
|
|
|
|
"golang.org/x/net/context"
|
|
)
|
|
|
|
func handlePprof(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
|
|
pprof.Handler(vars["name"]).ServeHTTP(w, r)
|
|
return nil
|
|
}
|