-
-
Notifications
You must be signed in to change notification settings - Fork 718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for HTTP extension methods #871
Labels
feature
New feature or request
Comments
Update, I was now able to write my own filter but it's not particularly pretty vs. what could be achieved if warp supported it directly. fn method(name: &str) -> impl Filter<Extract = (), Error = Rejection> + Clone {
let method =
Method::from_str(name).expect(&format!("Method name {} could not be converted", name));
warp::method()
.and_then(move |m: Method| {
let method = method.clone();
async move {
if m == method {
Ok(())
} else {
Err(reject::custom(GatewayHandlerError::MethodNotAllowed))
}
}
})
.untuple_one()
} |
outergod
added a commit
to outergod/warp
that referenced
this issue
Jun 29, 2021
outergod
added a commit
to outergod/warp
that referenced
this issue
Jul 1, 2021
seanmonstar
pushed a commit
that referenced
this issue
Sep 7, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
I'm trying to implement WebDAV handlers using warp, which requires filters for non-standard HTTP methods, as documented in RFC 4918. While
http::Method
allows defining custom methods, warp only provides a pre-defined set of filters for the standard methods and keepsmethod_is
infilters::method
private, so I couldn't figure out any other way to filter for custom methods.Describe the solution you'd like
Making
method_is
public would probably be enough already. warp could provide some sugar forMethod::from_bytes
, but that is not absolutely necessary.Describe alternatives you've considered
I could't figure out any other way to filter for the method in warp.
Additional context
N/A
The text was updated successfully, but these errors were encountered: