BSON and Protobuf binders used io.ReadAll with no cap. Add
binding.MaxBodyBytes (default 0, unlimited) and a shared reader so
apps can bound those binders without changing historical defaults.
Oversized bodies return *http.MaxBytesError, which MustBindWith
already maps to HTTP 413.
Fixes#4759
Signed-off-by: elix3r <157088510+22elix3r@users.noreply.github.com>
* Add interface to read body bytes in binding
* Add BindingBody implementation for some binding
* Fix to use `BindBodyBytesKey` for key
* Revert "Fix to use `BindBodyBytesKey` for key"
This reverts commit 2c82901ceab6ae53730a3cfcd9839bee11a08f13.
* Use private-like key for body bytes
* Add tests for BindingBody & ShouldBindBodyWith
* Add note for README
* Remove redundant space between sentences