mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-16 00:00:18 +02:00
Rename EmptyRouter to MethodNotAllowed (#411)
It is no longer needed in `Router` so can be changed to always return `403 Method Not Allowed`.
This commit is contained in:
+2
-2
@@ -4,7 +4,7 @@ use crate::{
|
||||
body::{box_body, BoxBody},
|
||||
extract::{FromRequest, RequestParts},
|
||||
response::IntoResponse,
|
||||
routing::{EmptyRouter, MethodRouter},
|
||||
routing::{MethodNotAllowed, MethodRouter},
|
||||
BoxError,
|
||||
};
|
||||
use async_trait::async_trait;
|
||||
@@ -78,7 +78,7 @@ pub trait Handler<B, T>: Clone + Send + Sized + 'static {
|
||||
/// ```
|
||||
fn layer<L>(self, layer: L) -> Layered<L::Service, T>
|
||||
where
|
||||
L: Layer<MethodRouter<Self, B, T, EmptyRouter>>,
|
||||
L: Layer<MethodRouter<Self, B, T, MethodNotAllowed>>,
|
||||
{
|
||||
Layered::new(layer.layer(crate::routing::any(self)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user