Fix IntoResponse for tuples overriding error response codes (#3603)

Co-authored-by: David Pedersen <[email protected]>
Co-authored-by: Yann Simon <[email protected]>
This commit is contained in:
Jonas Platte
2026-01-18 20:20:18 +01:00
committed by GitHub
co-authored by David Pedersen Yann Simon
parent 81e727faf6
commit 576968b406
10 changed files with 479 additions and 38 deletions
+7 -2
View File
@@ -1,6 +1,6 @@
use std::sync::Arc;
use axum_core::response::{IntoResponse, Response};
use axum_core::response::{IntoResponse, IntoResponseFailed, Response};
use bytes::{BufMut, Bytes, BytesMut};
use http::{header, HeaderValue, StatusCode};
use serde_core::Serialize;
@@ -78,7 +78,12 @@ impl IntoResponse for ErasedJson {
bytes,
)
.into_response(),
Err(err) => (StatusCode::INTERNAL_SERVER_ERROR, err.to_string()).into_response(),
Err(err) => (
StatusCode::INTERNAL_SERVER_ERROR,
IntoResponseFailed,
err.to_string(),
)
.into_response(),
}
}
}