File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,10 @@ type deltaProfiler interface {
2121}
2222
2323func init () {
24- http .HandleFunc ("/debug/pprof/delta_heap" , Heap )
25- http .HandleFunc ("/debug/pprof/delta_block" , Block )
26- http .HandleFunc ("/debug/pprof/delta_mutex" , Mutex )
24+ prefix := routePrefix ()
25+ http .HandleFunc (prefix + "/debug/pprof/delta_heap" , Heap )
26+ http .HandleFunc (prefix + "/debug/pprof/delta_block" , Block )
27+ http .HandleFunc (prefix + "/debug/pprof/delta_mutex" , Mutex )
2728}
2829
2930func Heap (w http.ResponseWriter , r * http.Request ) {
Original file line number Diff line number Diff line change 1+ //go:build !go1.22
2+
3+ package pprof
4+
5+ func routePrefix () string {
6+ return ""
7+ }
Original file line number Diff line number Diff line change 1+ //go:build go1.22
2+
3+ package pprof
4+
5+ func routePrefix () string {
6+ // As of go 1.23 we will panic if we don't prefix with "GET "
7+ // https://github.com/golang/go/blob/9fcffc53593c5cd103630d0d24ef8bd91e17246d/src/net/http/pprof/pprof.go#L98-L97
8+ // https://github.com/golang/go/commit/9fcffc53593c5cd103630d0d24ef8bd91e17246d
9+ return "GET "
10+ }
You can’t perform that action at this time.
0 commit comments