From b089d665ccd4bce00dbda30243626b87aea2ccb1 Mon Sep 17 00:00:00 2001 From: teor Date: Mon, 21 Feb 2022 12:47:16 +1000 Subject: [PATCH] fix(rpc): re-enable default RPC security checks --- zebrad/src/components/rpc.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/zebrad/src/components/rpc.rs b/zebrad/src/components/rpc.rs index 945624640cb..cd212419dd8 100644 --- a/zebrad/src/components/rpc.rs +++ b/zebrad/src/components/rpc.rs @@ -3,7 +3,7 @@ use futures::TryStreamExt; use hyper::{body::Bytes, Body}; use jsonrpc_core; -use jsonrpc_http_server::{DomainsValidation, RequestMiddleware, ServerBuilder}; +use jsonrpc_http_server::{RequestMiddleware, ServerBuilder}; use zebra_rpc::rpc::{Rpc, RpcImpl}; @@ -28,8 +28,8 @@ impl RpcServer { // TODO: use the same tokio executor as the rest of Zebra //.event_loop_executor(tokio::runtime::Handle::current()) .threads(1) - // TODO: if we enable this security check, does lightwalletd still work? - .allowed_hosts(DomainsValidation::Disabled) + // TODO: disable this security check if we see errors from lightwalletd. + //.allowed_hosts(DomainsValidation::Disabled) .request_middleware(FixHttpRequestMiddleware) .start_http(&config.listen_addr) .expect("Unable to start RPC server"); @@ -88,8 +88,8 @@ impl RequestMiddleware for FixHttpRequestMiddleware { }); jsonrpc_http_server::RequestMiddlewareAction::Proceed { - // TODO: if we enable this security check, does lightwalletd still work? - should_continue_on_invalid_cors: true, + // TODO: disable this security check if we see errors from lightwalletd. + should_continue_on_invalid_cors: false, request, } }