diff --git a/rpc/src/server.rs b/rpc/src/server.rs index c0c448a280..6d943211d5 100644 --- a/rpc/src/server.rs +++ b/rpc/src/server.rs @@ -85,11 +85,10 @@ impl RpcServer { enable_websocket: bool, ) -> Result { let stream_config = StreamServerConfig::default() + .with_keep_alive(true) .with_channel_size(4) .with_pipeline_size(4); - let cors = CorsLayer::permissive(); - // HTTP and WS server. let method_router = post(handle_jsonrpc::>).get(handle_jsonrpc_ws::>); @@ -97,7 +96,7 @@ impl RpcServer { .route("/", method_router.clone()) .route("/*path", method_router) .layer(Extension(Arc::clone(rpc))) - .layer(cors) + .layer(CorsLayer::permissive()) .layer(TimeoutLayer::new(Duration::from_secs(30))); if enable_websocket {