fix: correct return from lua res
This commit is contained in:
parent
84d7e20baa
commit
83527a7f59
@ -132,10 +132,13 @@ impl Service<Request<Body>> for Svc {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
match handler.call_async::<_, Res>((req, res)).await {
|
match handler.call_async::<_, Res>((req, res)).await {
|
||||||
Ok(res) => Ok(Response::builder()
|
Ok(res) => {
|
||||||
.status(res.status)
|
let body = if res.json != "" { res.json } else { res.body };
|
||||||
.body(Body::from(res.body))
|
Ok(Response::builder()
|
||||||
.unwrap()),
|
.status(res.status)
|
||||||
|
.body(Body::from(body))
|
||||||
|
.unwrap())
|
||||||
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
eprintln!("{}", err);
|
eprintln!("{}", err);
|
||||||
Ok(Response::builder()
|
Ok(Response::builder()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user