Skip to content
Snippets Groups Projects
Commit 497c5afc authored by gjahn's avatar gjahn
Browse files

Add body size limit

This is being handled by Fiber, hence not tested.
parent 8b087b50
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,9 @@ import (
)
const BODY_SIZE_LIMIT = 32 * 1024 * 1024 // 32 MB, in bytes
type Config struct {
Environment string `env:"ENV_NAME" envDefault:"development"`
Host string `env:"HOST" envDefault:"127.0.0.1"`
......
......@@ -26,6 +26,7 @@ func main() {
server := fiber.New( fiber.Config{
AppName: "webservice",
DisableStartupMessage: config.Environment != "development",
BodyLimit: configuration.BODY_SIZE_LIMIT,
})
var store state.Store
......
......@@ -28,6 +28,7 @@ func setup() ( *f.App, *configuration.Config, state.Store, *bool ){
server := f.New( f.Config{
AppName: "test",
DisableStartupMessage: false,
BodyLimit: configuration.BODY_SIZE_LIMIT,
})
store := state.NewEphemeralStore()
var isHealthy = true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment