mirror of https://github.com/gofiber/fiber.git
parent
9bbadddbb2
commit
2d6323c197
|
@ -34,7 +34,7 @@ func New() fiber.Handler {
|
|||
}
|
||||
// Switch to original path without stripped slashes
|
||||
switch path {
|
||||
case "/debug/pprof":
|
||||
case "/debug/pprof/":
|
||||
pprofIndex(c.Context())
|
||||
case "/debug/pprof/cmdline":
|
||||
pprofCmdline(c.Context())
|
||||
|
@ -61,7 +61,7 @@ func New() fiber.Handler {
|
|||
if strings.HasSuffix(path, "/") {
|
||||
path = strings.TrimRight(path, "/")
|
||||
} else {
|
||||
path = "/debug/pprof"
|
||||
path = "/debug/pprof/"
|
||||
}
|
||||
|
||||
return c.Redirect(path, fiber.StatusFound)
|
||||
|
|
|
@ -37,7 +37,7 @@ func Test_Pprof_Index(t *testing.T) {
|
|||
return c.SendString("escaped")
|
||||
})
|
||||
|
||||
resp, err := app.Test(httptest.NewRequest(fiber.MethodGet, "/debug/pprof", nil))
|
||||
resp, err := app.Test(httptest.NewRequest(fiber.MethodGet, "/debug/pprof/", nil))
|
||||
utils.AssertEqual(t, nil, err)
|
||||
utils.AssertEqual(t, 200, resp.StatusCode)
|
||||
utils.AssertEqual(t, fiber.MIMETextHTMLCharsetUTF8, resp.Header.Get(fiber.HeaderContentType))
|
||||
|
|
Loading…
Reference in New Issue