UI redirect to 127.0.0.1 when localhost requested (#7236)

* JS redirect from localhost -> 127.0.0.1

* ui-no-validation for 127.0.0.1

* Update with tests
This commit is contained in:
Jaco Greeff
2017-12-11 16:50:20 +01:00
committed by GitHub
parent 0fe018ff68
commit 9202ccccf7
6 changed files with 240 additions and 40 deletions

View File

@@ -567,7 +567,7 @@ impl Configuration {
}
fn dapps_config(&self) -> DappsConfiguration {
let dev_ui = if self.args.flag_ui_no_validation { vec![("localhost".to_owned(), 3000)] } else { vec![] };
let dev_ui = if self.args.flag_ui_no_validation { vec![("127.0.0.1".to_owned(), 3000)] } else { vec![] };
let ui_port = self.ui_port();
DappsConfiguration {
@@ -1578,7 +1578,7 @@ mod tests {
port: 8180,
hosts: Some(vec![]),
});
assert_eq!(conf1.dapps_config().extra_embed_on, vec![("localhost".to_owned(), 3000)]);
assert_eq!(conf1.dapps_config().extra_embed_on, vec![("127.0.0.1".to_owned(), 3000)]);
assert_eq!(conf1.ws_config().unwrap().origins, None);
assert_eq!(conf2.directories().signer, "signer".to_owned());
assert_eq!(conf2.ui_config(), UiConfiguration {