mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-09 00:00:12 +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.
|
/// An HTML response.
|
||||||
///
|
///
|
||||||
/// Will automatically get `Content-Type: text/html`.
|
/// Will automatically get `Content-Type: text/html`.
|
||||||
|
|||||||
Reference in New Issue
Block a user