gofiber/fiber latest releasev3.1.0
MinorContains breaking changes Released
🚀 New
- expand middleware context helpers (#4079)
app := fiber.New(fiber.Config{
PassLocalsToContext: true, // default: false
})
// Works for requestid, csrf, session, basicauth, keyauth middlewares
app.Use(requestid.New())
app.Get("/", func(ctx fiber.Ctx) error {
// Value helpers from middlewares works now with 3 different context items
id := requestid.FromContext(ctx) // works always
id := requestid.FromContext(ctx.RequestCtx()) // works always
id := requestid.FromContext(ctx.Context()) // works only when `PassLocalsToContext` is true
return c.SendString(id)
})
Show more