fix WS server expose issue. (#5728)

This commit is contained in:
Tomasz Drwięga 2017-06-03 14:41:42 +02:00 committed by Gav Wood
parent 5ec5d2fa0b
commit 68c8948294

View File

@ -778,6 +778,10 @@ impl Configuration {
}
fn ws_origins(&self) -> Option<Vec<String>> {
if self.args.flag_unsafe_expose {
return None;
}
Self::parse_hosts(&self.args.flag_ws_origins)
}
@ -1590,6 +1594,7 @@ mod tests {
assert_eq!(conf0.http_config().unwrap().hosts, None);
assert_eq!(&conf0.ws_config().unwrap().interface, "0.0.0.0");
assert_eq!(conf0.ws_config().unwrap().hosts, None);
assert_eq!(conf0.ws_config().unwrap().origins, None);
assert_eq!(&conf0.ui_config().interface, "0.0.0.0");
assert_eq!(conf0.ui_config().hosts, None);
assert_eq!(&conf0.secretstore_config().unwrap().interface, "0.0.0.0");