mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-20 00:00:11 +02:00
Implement IntoResponse for HeaderMap
This commit is contained in:
@@ -169,6 +169,14 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoResponse for HeaderMap {
|
||||
fn into_response(self) -> Response<Body> {
|
||||
let mut res = Response::new(Body::empty());
|
||||
*res.headers_mut() = self;
|
||||
res
|
||||
}
|
||||
}
|
||||
|
||||
/// An HTML response.
|
||||
///
|
||||
/// Will automatically get `Content-Type: text/html`.
|
||||
|
||||
Reference in New Issue
Block a user