diff --git a/src/internal/core/service.rs b/src/internal/core/service.rs index ac8ae7a..df78520 100644 --- a/src/internal/core/service.rs +++ b/src/internal/core/service.rs @@ -132,10 +132,13 @@ impl Service> 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()