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
+1 -1
View File
@@ -36,7 +36,7 @@ pub trait RouterExt<B>: sealed::Sealed {
impl<B> RouterExt<B> for Router<B>
where
B: Send + 'static,
B: axum::body::HttpBody + Send + 'static,
{
fn with<T>(self, routes: T) -> Self
where
+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}`.