Skip to content

Commit

Permalink
❌:fix #1360 (#1361)
Browse files Browse the repository at this point in the history
  • Loading branch information
bestgopher authored Jun 3, 2021
1 parent 9bbaddd commit 2d6323c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions middleware/pprof/pprof.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion middleware/pprof/pprof_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 2d6323c

Please # to comment.