Skip to content

Commit

Permalink
bugfix:Add a redirect form /debug/pprof to /debug/pprof
Browse files Browse the repository at this point in the history
To fix the bug where users opening /debug/pprof are redirected to an empty link,
  • Loading branch information
xiejunqiao committed Sep 28, 2024
1 parent 194fcaa commit ede7fcc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions services/httpd/pprof.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ func (h *Handler) handleProfiles(w http.ResponseWriter, r *http.Request) {
httppprof.Symbol(w, r)
case "/debug/pprof/all":
h.archiveProfilesAndQueries(w, r)
case "/debug/pprof":
// Add a redirect form /debug/pprof to /debug/pprof
// To fix the bug where users opening /debug/pprof are redirected to an empty link,
http.Redirect(w, r, "/debug/pprof/", http.StatusFound)
default:
httppprof.Index(w, r)
}
Expand Down

0 comments on commit ede7fcc

Please sign in to comment.