mirror of
https://github.com/tokio-rs/axum.git
synced 2024-11-22 23:30:29 +01:00
Implement IntoResponse
for HeaderMap
This commit is contained in:
parent
6d483a623a
commit
1fb80a1129
1 changed files with 8 additions and 0 deletions
|
@ -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`.
|
||||||
|
|
Loading…
Reference in a new issue