diff --git a/docs/partials/routing/handler.md b/docs/partials/routing/handler.md index 3ad6f7d7216..a83732b405f 100644 --- a/docs/partials/routing/handler.md +++ b/docs/partials/routing/handler.md @@ -114,7 +114,7 @@ app.Post("/api/register", func(c fiber.Ctx) error { }) ``` -# Use +## Use Can be used for middleware packages and prefix catchers. Prefixes now require either an exact match or a slash boundary, so `/john` matches `/john` and `/john/doe` but not `/johnnnnn`. Parameter tokens like `:name`, `:name?`, `*`, and `+` are still expanded before the boundary check runs. diff --git a/docs/whats_new.md b/docs/whats_new.md index e431b8ebe53..acbc2c8afef 100644 --- a/docs/whats_new.md +++ b/docs/whats_new.md @@ -159,7 +159,7 @@ import ( ) type CustomCtx struct { - fiber.Ctx + fiber.DefaultCtx } func (c *CustomCtx) CustomMethod() string { @@ -167,9 +167,9 @@ func (c *CustomCtx) CustomMethod() string { } func main() { - app := fiber.NewWithCustomCtx(func(app *fiber.App) fiber.Ctx { + app := fiber.NewWithCustomCtx(func(app *fiber.App) fiber.CustomCtx { return &CustomCtx{ - Ctx: *fiber.NewCtx(app), + DefaultCtx: *fiber.NewDefaultCtx(app), } })