Skip to main content

body_limit_layer

Function body_limit_layer 

Source
pub fn body_limit_layer(max_bytes: usize) -> DefaultBodyLimit
Expand description

Build the global request-body size cap (64 MiB by default).

Returns 413 Payload Too Large for any body that exceeds max_bytes when a handler tries to extract the body. See MAX_REQUEST_BODY_BYTES for the rationale on using axum’s native limit rather than tower-http’s.