github gofiber/fiber v2.42.0

latest releases: v3.0.0-beta.3, v2.52.5, v3.0.0-beta.2...
21 months ago

๐Ÿš€ New

// GET http://example.com/?id=5555
app.Get("/", func(c *fiber.Ctx) error {
    c.QueryInt("id", 1)         // 5555
    // ...
})

adds support for TLS 1.3's early data ("0-RTT") feature

app.Use(earlydata.New())

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,
    // ...
}))
// 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 of utils.UnsafeString, utils.UnsafeBytes in ctx.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.

Don't miss a new fiber release

NewReleases is sending notifications on new releases.