v2.42.0
🚀 New
- Ctx: Context method for query paramters with numbers (#2306)
https://docs.gofiber.io/api/ctx#queryint
// GET http://example.com/?id=5555
app.Get("/", func(c *fiber.Ctx) error {
c.QueryInt("id", 1) // 5555
// ...
})
- Middleware/earlydata: Add earlydata middleware (v2 backport) (#2314)
https://docs.gofiber.io/api/middleware/earlydata
adds support for TLS 1.3's early data ("0-RTT") feature
app.Use(earlydata.New())
- Middleware/idempotency: Add idempotency middleware (v2 backport) (#2288)
https://docs.gofiber.io/api/middleware/idempotency
allows for fault-tolerant APIs where duplicate requests — for example due to networking issues on the client-side — do not erroneously cause the same action performed multiple times on the server-side.
app.Use(idempotency.New(idempotency.Config{
Lifetime: 42 * time.Minute,
// ...
}))
- Middleware/proxy: Add forward from domain (#2323)
https://docs.gofiber.io/api/middleware/proxy
// If you want to forward with a specific domain. You have to use proxy.DomainForward.
app.Get("/payments", proxy.DomainForward("docs.gofiber.io", "http://localhost:8000"))
// Or this way if the balancer is using https and the destination server is only using http.
app.Use(proxy.BalancerForward([]string{
"http://localhost:3001",
"http://localhost:3002",
"http://localhost:3003",
}))
🧹 Updates/CI
- Middleware/favicon: Add url for favicon middleware, for correct handling different of… (#2231)
https://docs.gofiber.io/api/middleware/favicon - CI: Add go 1.20 to ci and readmes (#2322)
- CI: Add and apply more stricter golangci-lint linting rules (#2286)
- CI: Added testcases and minor algorithm improvment (#2308)
- CI: Make most tests parallel (#2299)
- CI: Bump github.com/valyala/fasthttp from 1.43.0 to 1.44.0 (#2292)
🐛 Fixes
- CI: Fix issues introduced in linting PR (#2319)
- Use
app.getString, app.GetBytes
instead ofutils.UnsafeString, utils.UnsafeBytes
inctx.go
(#2297) - Os: Fix gopsutil compilation (#2298)
- Middleware/logger: logger color output (#2296)
📚 Documentation
- Rework Chinese (Taiwan) translation of documentation (#2310)
- Correct the figure link in READMEs (#2312)
- Remove the redundant space beside a comma (#2309)
- Add discord channel link (ID) (#2303)
- Middleware/filesystem: fix statik filesystem middleware example typo (#2302)
- Middleware/filesystem: clean duplicated namespace for example (#2313)
- Middleware/limiter: fix alignment in limiter example (#2283)
- Middleware/encryptcookie: Openssl rand -base64 32 hints (#2316)
Full Changelog: v2.41.0...v2.42.0
Thank you @0xdeface, @100gle, @TwiN, @cloudwindy, @dozheiny, @efectn, @leonklingele, @meehow, @pan93412, @rendiputra and @rhabichl for making this update possible.