-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 pprof middleware redirect index page to wrong url #1360
Comments
Thanks for opening your first issue here! 🎉 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord |
@bestgopher you have customized this exact place in the pull request, can you give feedback on this issue |
@kurefm Could you fix the bug? |
@ReneWerner87 Sorry for this bug caused by me. I think pprof as a middleware is not a good choice, it should be registered in the router. As a middleware, everyone can access this path, and it is difficult for us to authenticate it. |
what do you mean that it should be registered in the router and not as middleware ? via middleware a handler is registered and the same possibility exists also only in the router besides it is better kept as a separate middleware, because it can then be used by anyone who wants or left out. what do you mean by the last sentence, you can put another middleware in front of the middleware and do any kind of check if a request is allowed to access here or not, that's the advantage of the middlewares and the chaining of them but more importantly who makes the fix ? @bestgopher or @kurefm ? |
How to achieve this:
|
Fiber version
v2.11.0
Issue description
The pprof middleware should redirect
/debug/pprof
to/debug/pprof/
, but not redirect/debug/pprof/
to/debug/pprof
.Because of pprof index page use relative herf path,
/debug/pprof
make sub page (e.g/debug/pprof/allocs
) herf link become/debug/allocs
The text was updated successfully, but these errors were encountered: