mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-01 14:47:24 +00:00
Disable CORS when running in --dev (#2291)
* Disable cors in dev mode, * Whitelist substrate-ui. * Fix build. * Update docs.
This commit is contained in:
committed by
Bastian Köcher
parent
47c1b4b26e
commit
a6cbc965a0
@@ -475,11 +475,18 @@ 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()
|
||||
]));
|
||||
let is_dev = cli.shared_params.dev;
|
||||
config.rpc_cors = cli.rpc_cors.unwrap_or_else(|| if is_dev {
|
||||
log::warn!("Running in --dev mode, RPC CORS has been disabled.");
|
||||
None
|
||||
} else {
|
||||
Some(vec![
|
||||
"http://localhost:*".into(),
|
||||
"https://localhost:*".into(),
|
||||
"https://polkadot.js.org".into(),
|
||||
"https://substrate-ui.parity.io".into(),
|
||||
])
|
||||
});
|
||||
|
||||
// Override telemetry
|
||||
if cli.no_telemetry {
|
||||
|
||||
Reference in New Issue
Block a user