Unverified Commit c94d097a authored by Michael Feil's avatar Michael Feil Committed by GitHub
Browse files

fix: get_body_limit() body limit size for response middleware. (#5268)


Signed-off-by: default avatarmichaelfeil <me@michaelfeil.eu>
parent 2f9812aa
......@@ -224,7 +224,7 @@ pub async fn smart_json_error_middleware(request: Request<Body>, next: Next) ->
if response.status() == StatusCode::UNPROCESSABLE_ENTITY {
let (_parts, body) = response.into_parts();
let body_bytes = axum::body::to_bytes(body, usize::MAX)
let body_bytes = axum::body::to_bytes(body, get_body_limit())
.await
.unwrap_or_default();
let error_message = String::from_utf8_lossy(&body_bytes).to_string();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment