Beta backports (#4569)
* Fixing evmbin compilation and added standard build. (#4561) * Alias for personal_sendTransaction (#4554) * Fix console dapp (#4544) * Fixing linting issues. Better support for console as secure app * Fixing linting issues * Fix no data sent in TxQueue dapp (#4502) * Fix wrong PropType req for Embedded Signer * Fix wrong data for tx #4499
This commit is contained in:
@@ -21,11 +21,15 @@ use jsonrpc_core::{IoHandler, ResponseHandler, Request, Response};
|
||||
use jsonrpc_http_server::{ServerHandler, PanicHandler, AccessControlAllowOrigin, RpcHandler};
|
||||
use endpoint::{Endpoint, EndpointPath, Handler};
|
||||
|
||||
pub fn rpc(handler: Arc<IoHandler>, panic_handler: Arc<Mutex<Option<Box<Fn() -> () + Send>>>>) -> Box<Endpoint> {
|
||||
pub fn rpc(
|
||||
handler: Arc<IoHandler>,
|
||||
cors_domains: Vec<String>,
|
||||
panic_handler: Arc<Mutex<Option<Box<Fn() -> () + Send>>>>,
|
||||
) -> Box<Endpoint> {
|
||||
Box::new(RpcEndpoint {
|
||||
handler: Arc::new(RpcMiddleware::new(handler)),
|
||||
panic_handler: panic_handler,
|
||||
cors_domain: None,
|
||||
cors_domain: Some(cors_domains.into_iter().map(AccessControlAllowOrigin::Value).collect()),
|
||||
// NOTE [ToDr] We don't need to do any hosts validation here. It's already done in router.
|
||||
allowed_hosts: None,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user