mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-07 00:00:12 +02:00
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:
co-authored by
David Pedersen
Yann Simon
parent
81e727faf6
commit
576968b406
@@ -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(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user