mirror of
https://github.com/gin-gonic/gin.git
synced 2026-09-04 22:53:34 +08:00
feat: add MaxBodySize configurable limit for BSON/Protobuf binders
This commit is contained in:
parent
49f4e069f2
commit
3f68b0b0b4
@ -125,3 +125,9 @@ func validate(obj any) error {
|
||||
}
|
||||
return Validator.ValidateStruct(obj)
|
||||
}
|
||||
|
||||
// MaxBodySize is the maximum request body size in bytes that BSON and
|
||||
// Protobuf binders will read. If the request body exceeds this limit,
|
||||
// the binding returns an error. Defaults to 32 MB.
|
||||
var MaxBodySize int64 = 32 << 20
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user