mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-02 00:00:22 +02:00
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:
@@ -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
|
||||
|
||||
@@ -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}`.
|
||||
|
||||
Reference in New Issue
Block a user