Enable CORS checks (#2248)

* Introduce CORS CLI flags.

* Fix test.
This commit is contained in:
Tomasz Drwięga
2019-04-10 23:47:27 +02:00
committed by Bastian Köcher
parent 0b2c3ae860
commit 25f56283b1
7 changed files with 54 additions and 6 deletions
+5
View File
@@ -475,6 +475,11 @@ where
config.rpc_ws = Some(
parse_address(&format!("{}:{}", ws_interface, 9944), cli.ws_port)?
);
config.rpc_cors = cli.rpc_cors.unwrap_or_else(|| Some(vec![
"http://localhost:*".into(),
"https://localhost:*".into(),
"https://polkadot.js.org".into()
]));
// Override telemetry
if cli.no_telemetry {