|
|
|
@ -43,20 +43,19 @@ pub fn put(mut state: State) -> Box<HandlerFuture> {
|
|
|
|
|
|
|
|
|
|
future::ok((state, res))
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
Err(e) => {
|
|
|
|
|
let err = Error::new(ErrorKind::Other, e.description());
|
|
|
|
|
future::err((state, err.into_handler_error()))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
Err(e) => future::err((state, e.into_handler_error())),
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn post(mut state: State) -> Box<HandlerFuture> {
|
|
|
|
|
Box::new({
|
|
|
|
|
Body::take_from(&mut state).concat2().then(|body| {
|
|
|
|
@ -86,12 +85,7 @@ pub fn post(mut state: State) -> Box<HandlerFuture> {
|
|
|
|
|
|
|
|
|
|
future::ok((state, res))
|
|
|
|
|
} else {
|
|
|
|
|
let res = create_response(
|
|
|
|
|
&state,
|
|
|
|
|
StatusCode::OK,
|
|
|
|
|
mime::TEXT_PLAIN,
|
|
|
|
|
"ERR"
|
|
|
|
|
);
|
|
|
|
|
let res = create_response(&state, StatusCode::OK, mime::TEXT_PLAIN, "ERR");
|
|
|
|
|
|
|
|
|
|
future::ok((state, res))
|
|
|
|
|
}
|
|
|
|
|