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();
|
||||
|
||||
match handler.call_async::<_, Res>((req, res)).await {
|
||||
Ok(res) => Ok(Response::builder()
|
||||
.status(res.status)
|
||||
.body(Body::from(res.body))
|
||||
.unwrap()),
|
||||
Ok(res) => {
|
||||
let body = if res.json != "" { res.json } else { res.body };
|
||||
Ok(Response::builder()
|
||||
.status(res.status)
|
||||
.body(Body::from(body))
|
||||
.unwrap())
|
||||
}
|
||||
Err(err) => {
|
||||
eprintln!("{}", err);
|
||||
Ok(Response::builder()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user