Skip to content

Commit

Permalink
Limit request bytes (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldebruijn authored Oct 16, 2024
1 parent 91d9a3f commit 5afcf19
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/app/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package http

import "time"

const kilobyte100 = 102_400 // 100kb

type Config struct {
ReadTimeout time.Duration `yaml:"read_timeout"`
WriteTimeout time.Duration `yaml:"write_timeout"`
Expand All @@ -22,6 +24,6 @@ func DefaultConfig() Config {
ShutdownTimeout: 20 * time.Second,
Host: "0.0.0.0:8080",
Path: "/graphql",
RequestBodyMaxBytes: 102_400, // 100kb
RequestBodyMaxBytes: kilobyte100,
}
}

0 comments on commit 5afcf19

Please sign in to comment.