Documentation
¶
Overview ¶
Package bodycap caps every response body an http.Client reads at MaxBytes, whatever length the response declares.
Index ¶
Constants ¶
View Source
const MaxBytes = 1 << 20
MaxBytes is the most a capped body hands out.
Variables ¶
View Source
var ErrTooLarge = errors.New("oidc: response body larger than 1 MiB")
ErrTooLarge is the error a capped body fails with once it holds a byte past MaxBytes.
Functions ¶
This section is empty.
Types ¶
type Transport ¶
type Transport struct{ Next http.RoundTripper }
Transport caps the response body, not the dial, so it sits outside an SSRF-guarding transport without weakening it.
Click to show internal directories.
Click to hide internal directories.