From 21dfc543251b45cdc47a6f075aa030d5795c002e Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Mon, 25 Apr 2022 23:49:08 +0300 Subject: [PATCH] Fix CORS (#174) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix CORS Co-authored-by: Özgün Özerk --- src-tauri/src/node.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src-tauri/src/node.rs b/src-tauri/src/node.rs index 4165ad03..b1b12619 100644 --- a/src-tauri/src/node.rs +++ b/src-tauri/src/node.rs @@ -171,9 +171,17 @@ fn create_configuration( rpc_http: None, rpc_ws: Some("127.0.0.1:9944".parse().expect("IP and port are valid")), rpc_ipc: None, - rpc_methods: RpcMethods::Unsafe, + rpc_methods: RpcMethods::Safe, rpc_ws_max_connections: None, - rpc_cors: None, + // Below CORS are default from Substrate + rpc_cors: Some(vec![ + "http://localhost:*".to_string(), + "http://127.0.0.1:*".to_string(), + "https://localhost:*".to_string(), + "https://127.0.0.1:*".to_string(), + "https://polkadot.js.org".to_string(), + "tauri://localhost".to_string(), + ]), rpc_max_payload: None, ws_max_out_buffer_capacity: None, prometheus_config: None,