You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to debug my Go project with net/http/pprof , so I writed a code snippet as below.
And I think it could be a recipe of fiber 😄
package main
import (
"github.com/gofiber/fiber""github.com/valyala/fasthttp/pprofhandler"
)
funcmain() {
// Create new Fiber instanceapp:=fiber.New()
// Create new group route on path "/debug/pprof"app.Group("/debug/pprof", func(c*fiber.Ctx) {
pprofhandler.PprofHandler(c.Fasthttp)
})
// Start server on http://localhost:3000app.Listen(3000)
}
If you visit http://localhost:3000/debug/pprof/ , everything is ok.
But if you visit http://localhost:3000/debug/pprof , the right subpath like http://localhost:3000/debug/pprof/goroutine will be replaced with the wrong subpath http://localhost:3000/debug/goroutine , so you will get nothing but 404.
Describe alternatives you've considered
It's because of pprof's template depends on the last / to separate different subpaths, so you should always visit http://localhost:3000/debug/pprof/ 😄
Additional context
Always use Safari to visit http://localhost:3000/debug/pprof to get 404.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem?
Yes, but not fiber's problem, I think.
Describe the solution you'd like
I want to debug my Go project with net/http/pprof , so I writed a code snippet as below.
And I think it could be a recipe of fiber 😄
If you visit
http://localhost:3000/debug/pprof/
, everything is ok.But if you visit
http://localhost:3000/debug/pprof
, the right subpath likehttp://localhost:3000/debug/pprof/goroutine
will be replaced with the wrong subpathhttp://localhost:3000/debug/goroutine
, so you will get nothing but 404.Describe alternatives you've considered
It's because of pprof's template depends on the last
/
to separate different subpaths, so you should always visithttp://localhost:3000/debug/pprof/
😄Additional context
Always use Safari to visit
http://localhost:3000/debug/pprof
to get 404.The text was updated successfully, but these errors were encountered: