Set content-length for responses to HEAD requests (#734)

* Set `content-length` internally in `Router`

* changelog

* require `B: HttpBody` at the `impl`

* add changelog refs
This commit is contained in:
David Pedersen
2022-01-31 13:48:51 +01:00
committed by GitHub
parent 84df7eaa38
commit 515495d957
9 changed files with 165 additions and 61 deletions
+4 -1
View File
@@ -54,7 +54,10 @@ pub struct Resource<B = Body> {
pub(crate) router: Router<B>,
}
impl<B: Send + 'static> Resource<B> {
impl<B> Resource<B>
where
B: axum::body::HttpBody + Send + 'static,
{
/// Create a `Resource` with the given name.
///
/// All routes will be nested at `/{resource_name}`.