Skip to content

Commit c94d097

Browse files
authored
fix: get_body_limit() body limit size for response middleware. (#5268)
Signed-off-by: michaelfeil <[email protected]>
1 parent 2f9812a commit c94d097

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/llm/src/http/service/openai.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ pub async fn smart_json_error_middleware(request: Request<Body>, next: Next) ->
224224

225225
if response.status() == StatusCode::UNPROCESSABLE_ENTITY {
226226
let (_parts, body) = response.into_parts();
227-
let body_bytes = axum::body::to_bytes(body, usize::MAX)
227+
let body_bytes = axum::body::to_bytes(body, get_body_limit())
228228
.await
229229
.unwrap_or_default();
230230
let error_message = String::from_utf8_lossy(&body_bytes).to_string();

0 commit comments

Comments
 (0)