fix: correct return from lua res

This commit is contained in:
ato 2023-02-16 19:03:55 +01:00
parent 84d7e20baa
commit 83527a7f59

View File

@ -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()