Documentation
¶
Overview ¶
Package reqbody centralizes bounded HTTP request body reads for frontend handlers.
Index ¶
Constants ¶
View Source
const DefaultMaxBytes int64 = 8 << 20
DefaultMaxBytes is the maximum request body size when no explicit limit is set.
Variables ¶
This section is empty.
Functions ¶
func ReadAll ¶
ReadAll reads r.Body using http.MaxBytesReader. On limit exceeded it returns a non-nil err for which TooLarge returns true; callers should respond with HTTP 413 without treating it as JSON parse failure.
When the request advertises Content-Encoding: gzip, the body is transparently decompressed and the byte limit is applied to the decompressed size (mitigating decompression bombs).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.