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:
David Pedersen
2021-10-26 21:11:33 +00:00
committed by GitHub
parent 94330b7796
commit a2627e9084
5 changed files with 5 additions and 44 deletions
-20
View File
@@ -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.