mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-01 00:00:14 +02:00
Remove support for CONNECT (#428)
Given how different `CONNECT` requests are I think its fine to require users to handle them manually. Since they don't contain paths you probably don't need a full routing framework 🤷 An example can be found [here](https://github.com/tokio-rs/axum/blob/main/examples/http-proxy/src/main.rs) Fixes #418
This commit is contained in:
@@ -130,16 +130,6 @@ where
|
||||
on(MethodFilter::all(), svc)
|
||||
}
|
||||
|
||||
/// Route `CONNECT` requests to the given service.
|
||||
///
|
||||
/// See [`get`] for an example.
|
||||
pub fn connect<S, B>(svc: S) -> MethodRouter<S, MethodNotAllowed<S::Error>, B>
|
||||
where
|
||||
S: Service<Request<B>> + Clone,
|
||||
{
|
||||
on(MethodFilter::CONNECT, svc)
|
||||
}
|
||||
|
||||
/// Route `DELETE` requests to the given service.
|
||||
///
|
||||
/// See [`get`] for an example.
|
||||
@@ -319,16 +309,6 @@ impl<S, F, B> MethodRouter<S, F, B> {
|
||||
self.on(MethodFilter::all(), svc)
|
||||
}
|
||||
|
||||
/// Chain an additional service that will only accept `CONNECT` requests.
|
||||
///
|
||||
/// See [`MethodRouter::get`] for an example.
|
||||
pub fn connect<T>(self, svc: T) -> MethodRouter<T, Self, B>
|
||||
where
|
||||
T: Service<Request<B>> + Clone,
|
||||
{
|
||||
self.on(MethodFilter::CONNECT, svc)
|
||||
}
|
||||
|
||||
/// Chain an additional service that will only accept `DELETE` requests.
|
||||
///
|
||||
/// See [`MethodRouter::get`] for an example.
|
||||
|
||||
Reference in New Issue
Block a user