- Changed the behavior of
response.File()
andresponse.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 invalid4
: An error occurred when opening network listener5
: 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 everytimegetHTTPClient()
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 themaxUploadSize
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.