1
0
Fork 0
mirror of https://gitlab.com/msrd0/gotham-restful.git synced 2025-07-12 07:11:29 +00:00

I don't know how I ended up with spaces

This commit is contained in:
Dominic 2020-05-16 14:26:21 +02:00
parent dc26e9a02e
commit 955715eea6
Signed by: msrd0
GPG key ID: DCC8C247452E98F9
5 changed files with 26 additions and 26 deletions

View file

@ -76,7 +76,7 @@ let matcher = AcceptHeaderMatcher::new(types);
# build_simple_router(|route| {
// use the matcher for your request
route.post("/foo")
.extend_route_matcher(matcher)
.extend_route_matcher(matcher)
.to(|state| {
// we know that the client is a modern browser and can handle webp images
# let IMAGE_WEBP : mime::Mime = "image/webp".parse().unwrap();

View file

@ -48,7 +48,7 @@ impl RouteMatcher for AccessControlRequestMethodMatcher
{
match HeaderMap::borrow_from(state).get(ACCESS_CONTROL_REQUEST_METHOD)
.and_then(|value| value.to_str().ok())
.and_then(|str| str.parse::<Method>().ok())
.and_then(|str| str.parse::<Method>().ok())
{
Some(m) if m == self.method => Ok(()),
_ => Err(RouteNonMatch::new(StatusCode::NOT_FOUND))

View file

@ -26,7 +26,7 @@ let matcher = ContentTypeMatcher::new(types)
# build_simple_router(|route| {
// use the matcher for your request
route.post("/foo")
.extend_route_matcher(matcher)
.extend_route_matcher(matcher)
.to(|state| {
let res = create_response(&state, StatusCode::OK, mime::TEXT_PLAIN, "Correct Content Type!");
(state, res)