github go-goyave/goyave v2.10.1
Release v2.10.1

latest releases: v5.3.0, v5.2.1, v5.2.0...
4 years ago
  • Changed the behavior of response.File() and response.Download() to respond with a status 404 if the given file doesn't exist instead of panicking.
  • Improved error handling:
    • log.Panicf is not used anymore to print panics, removing possible duplicate logs.
    • Added error checks during automatic migrations.
    • goyave.Start() now exits the program with the following error codes:
      • 2: Panic (server already running, error when loading language files, etc)
      • 3: Configuration is invalid
      • 4: An error occurred when opening network listener
      • 5: An error occurred in the HTTP server

This change will require a slightly longer main function but offers better flexibility for error handling and multi-services.

if err := goyave.Start(route.Register); err != nil {
	os.Exit(err.(*goyave.Error).ExitCode)
}
  • Fixed a bug in TestSuite: HTTP client was re-created everytime getHTTPClient() was called.
  • Fixed testing documentation examples that didn't close http response body.
  • Documentation meta improvements.
  • Protect JSON requests with maxUploadSize.
  • The server will now automatically return 413 Payload Too Large if the request's size exceeds the maxUploadSize defined in configuration.
  • The request parsing middleware doesn't drain the body anymore, improving native handler compatibility.
  • Set a default status handler for all 400 errors.
  • Fixed a bug preventing query parameters to be parsed when the request had the Content-Type: application/json header.
  • Added a dark theme for the documentation. It can be toggled by clicking the moon icon next to the search bar.

Don't miss a new goyave release

NewReleases is sending notifications on new releases.