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:
parent
dc26e9a02e
commit
955715eea6
5 changed files with 26 additions and 26 deletions
|
@ -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();
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue