Commit bc8b1216 authored by Nemanja Zbiljić's avatar Nemanja Zbiljić Committed by GitHub

Redirect '/debug/pprof' to endpoint with slash (#789)

parent 47052b24
......@@ -32,7 +32,11 @@ func (s *server) setupRouting() {
router := mux.NewRouter()
router.NotFoundHandler = http.HandlerFunc(jsonhttp.NotFoundHandler)
router.Handle("/debug/pprof", http.HandlerFunc(pprof.Index))
router.Handle("/debug/pprof", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
u := r.URL
u.Path += "/"
http.Redirect(w, r, u.String(), http.StatusPermanentRedirect)
}))
router.Handle("/debug/pprof/cmdline", http.HandlerFunc(pprof.Cmdline))
router.Handle("/debug/pprof/profile", http.HandlerFunc(pprof.Profile))
router.Handle("/debug/pprof/symbol", http.HandlerFunc(pprof.Symbol))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment