🚀 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)
})
https://docs.gofiber.io/api/fiber/#passlocalstocontext
🧹 Updates
- update utils and add go 1.26 for test workflow (#4087)
- optimize helpers performance (#4049)
- harden numeric constraint parsing and expand route tests (#4054)
🐛 Fixes
- harden DefaultRes.Format against nil handler panics (#4105)
- guard nil request in adaptor LocalContextFromHTTPRequest (#4097)
- fix Unix-socket support in IsProxyTrusted (#4088)
- harden proxy nil client handling in Do/Forward paths (#4083)
- add nil-safety to response decode helpers (#4081)
- sanitize attachment/download filenames (#4070)
- harden flash cookie detection (#4078)
- fix bind struct validation only for struct targets (#4082)
- enforce Range header limit configuration (#4071)
- apply limits to msgp serialization (#4065) …