src/server/rest.rs: use correct formatter
This commit is contained in:
parent
3383973532
commit
4299ca727c
|
@ -550,13 +550,19 @@ pub async fn handle_request(api: Arc<ApiConfig>, req: Request<Body>) -> Result<R
|
||||||
return Ok((formatter.format_error)(err));
|
return Ok((formatter.format_error)(err));
|
||||||
}
|
}
|
||||||
Some(api_method) => {
|
Some(api_method) => {
|
||||||
if api_method.protected && env_type == RpcEnvironmentType::PUBLIC {
|
let result = if api_method.protected && env_type == RpcEnvironmentType::PUBLIC {
|
||||||
return proxy_protected_request(api_method, parts, body).await;
|
proxy_protected_request(api_method, parts, body).await
|
||||||
} else {
|
} else {
|
||||||
return handle_api_request(rpcenv, api_method, formatter, parts, body, uri_param).await;
|
handle_api_request(rpcenv, api_method, formatter, parts, body, uri_param).await
|
||||||
}
|
};
|
||||||
|
|
||||||
|
if let Err(err) = result {
|
||||||
|
return Ok((formatter.format_error)(err));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// not Auth required for accessing files!
|
// not Auth required for accessing files!
|
||||||
|
|
Loading…
Reference in New Issue