Skip to content

v1.11.0

Compare
Choose a tag to compare
@Fenny Fenny released this 08 Jun 10:39
164fbb3

v1.11.x contains the new ErrorHandler #423 and started to move some popular middleware to the fiber core, more will follow:

🔥 New

var (
  ErrContinue             = NewError(StatusContinue)                // RFC 7231, 6.2.1
  ErrSwitchingProtocols   = NewError(StatusSwitchingProtocols)      // RFC 7231, 6.2.2
  // etc...
  • app.App()
    App returns the *App reference to access Settings or ErrorHandler
  • app.Routes()
    Routes returns all registered routes
  • app.Settings.ErrorHandler
    Fiber supports centralized error handling by passing an error argument into the Next method which allows you to log errors to external services or send a customized HTTP response to the client.
  • ctx.SendStream
    Sets response body stream and optional body size
  • app.Settings.CompressedFileSuffix
    The suffix that is used when a compressed file under the new file name is made, defaults to .fiber.gz.

🩹 Fixes

  • Return 404 if c.Next() has no match #430
  • Partial wildcard support in Static, due to the Fasthttp update we had to adjust our PathRewrite rewrite function. Thanks for the fix @ReneWerner87
  • utf-8 charset is now the default for content-type related ctx methods
  • Fix content-type issue with multiple Static routes #420

🧹 Updates

  • ctx.Download() error
    returns an error
  • ctx.SendFile() error
    returns an error and add support for range requests by default
  • If a route does not match the request, the 404 response will contain Cannot %method %path
  • Added io.Reader support in ctx.Send
  • Added io.Reader support in ctx.Write

🧬 External Middlewares