v2.51.0
🚀 New
- Add support for parameters in content negotiation (#2678) RFC
https://docs.gofiber.io/api/ctx#accepts
// Consideration of parameters in the accepted headers
// Accept: text/plain, application/json; version=1; foo=bar
app.Get("/", func(c *fiber.Ctx) error {
// Extra parameters in the accept are ignored
c.Accepts("text/plain;format=flowed") // "text/plain;format=flowed"
// An offer must contain all parameters present in the Accept type
c.Accepts("application/json") // ""
// Parameter order and capitalization does not matter. Quotes on values are stripped.
c.Accepts(`application/json;foo="bar";VERSION=1`) // "application/json;foo="bar";VERSION=1"
})
- Add support for application/problem+json (#2704)
https://docs.gofiber.io/api/ctx#json
https://docs.gofiber.io/api/client#json
// Passing a custom json type
ctx.JSON(fiber.Map{
"type": "https://example.com/probs/out-of-credit",
"title": "You do not have enough credit.",
"status": 403,
"detail": "Your current balance is 30, but that costs 50.",
"instance": "/account/12345/msgs/abc",
}, fiber.)
🧹 Updates
🛠️ Maintenance
- Bump golang.org/x/sys from 0.13.0 to 0.14.0 (#2707)
- Bump github.com/google/uuid from 1.3.1 to 1.4.0 (#2693)
- Bump actions/setup-node from 3 to 4 (#2690)
- Bump github.com/mattn/go-isatty from 0.0.19 to 0.0.20 (#2679)
🐛 Fixes
- Middleware/limiter: fix intermittent failures (#2716)
- Naming of routes works wrong after mount #2688 (#2689)
- Fix method validation on route naming (#2686)
📚 Documentation
- Changed "Twitter" to "X (Twitter)" in README.md Contribute Section (#2696)
- Add additional information as to why GetReqHeaders returns a map where the values are slices of strings (#2698)
- Enhance csrf.md (#2692)
Full Changelog: v2.50.0...v2.51.0
Thank you @BandhiyaHardik, @database64128, @efectn, @moritz157, @nickajacks1, @rhburt and @sixcolors for making this update possible.