v2.43.0
❗ BreakingChange
- Drop go 1.16 support & update to fasthttp 1.45.0 (#2374)
Due to the fact that fasthttp, which fiber is based on in release 1.45.0, does not support go version 1.16 anymore, we had to remove it from our package as well.
🚀 New
- Allow preloaded certs with prefork (#2351)
https://docs.gofiber.io/api/app#listentlswithcertificate
https://docs.gofiber.io/api/app#listenmutualtlswithcertificate
app.ListenTLSWithCertificate(":443", cert);
app.ListenMutualTLSWithCertificate(":443", cert, clientCertPool);
- Add queryBool parser (#2329)
https://docs.gofiber.io/api/ctx#querybool
// GET http://example.com/?name=alex&want_pizza=false&id=
app.Get("/", func(c *fiber.Ctx) error {
c.QueryBool("want_pizza") // false
c.QueryBool("want_pizza", true) // false
c.QueryBool("alex") // true
c.QueryBool("alex", false) // false
c.QueryBool("id") // true
c.QueryBool("id", false) // false
// ...
})
- Add queryFloat parser (#2328)
https://docs.gofiber.io/api/ctx#queryfloat
// GET http://example.com/?name=alex&amount=32.23&id=
app.Get("/", func(c *fiber.Ctx) error {
c.QueryFloat("amount") // 32.23
c.QueryFloat("amount", 3) // 32.23
c.QueryFloat("name", 1) // 1
c.QueryFloat("name") // 0
c.QueryFloat("id", 3) // 3
// ...
})
- Middleware/session: SessionOnly when cookie.Expires is 0 (#2152)
https://docs.gofiber.io/api/middleware/session
session.New(session.Config{
// Decides whether cookie should last for only the browser sesison.
CookieSessionOnly: true,
})
- Middleware/proxy: Add DoRedirects, DoTimeout and DoDeadline to Proxy middleware (#2332)
https://docs.gofiber.io/api/middleware/proxy
// DoRedirects performs the given http request and fills the given http response while following up to maxRedirectsCount redirects.
func DoRedirects(c *fiber.Ctx, addr string, maxRedirectsCount int, clients ...*fasthttp.Client) error
// DoDeadline performs the given request and waits for response until the given deadline.
func DoDeadline(c *fiber.Ctx, addr string, deadline time.Time, clients ...*fasthttp.Client) error
// DoTimeout performs the given request and waits for response during the given timeout duration.
func DoTimeout(c *fiber.Ctx, addr string, timeout time.Duration, clients ...*fasthttp.Client) error
🧹 Updates
- Get mime fallback (#2340)
- Middleware/requestid: don't call "Generator" func on existing request ID header (#2371)
- Middleware/basicauth: Optimize Basic auth alloc (#2333)
🐛 Fixes
- Middleware/requestid: Config.ContextKey is interface{} (#2369)
- Middleware/cors: Fix cors * behavior #2338 (#2339)
📚 Documentation
- Use proper discord invitation link (#2382)
- Corrected coding typos in MountPath docs section (#2379)
- Fix typo in docs (#2357)
- Fix(docs): add missing comma (#2353)
- Fix all inaccessible links in docs (#2349)
- Automated synchronization with
gofiber/docs
(#2344)
Full Changelog: v2.42.0...v2.43.0
Thank you @CaioAugustoo, @HHongSeungWoo, @IwateKyle, @Rorke76753, @Skyenought, @UtopiaGitHub, @benjajaja, @derkan, @dozheiny, @efectn, @gaby, @leonklingele, @lublak, @msaf1980, @ryand67 and @yvestumushimire for making this update possible.