diff options
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | mullvad-cli/src/cmds/relay.rs | 24 |
2 files changed, 13 insertions, 13 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index f48c909157..82b26a4772 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,8 @@ Line wrap the file at 100 chars. Th - Gradually increase the WireGuard connectivity check timeout, lowering the timeout for the first few attempts. - Stop preferring OpenVPN when bridge mode is enabled. +- CLI command for setting a specific server by hostname is no longer case sensitive. + Example: `mullvad relay set hostname SE9-WIREGUARD` should now work. #### Android - Avoid running in foreground when not connected. diff --git a/mullvad-cli/src/cmds/relay.rs b/mullvad-cli/src/cmds/relay.rs index 11e36e0d98..28baab3062 100644 --- a/mullvad-cli/src/cmds/relay.rs +++ b/mullvad-cli/src/cmds/relay.rs @@ -393,11 +393,15 @@ impl Relay { let countries = Self::get_filtered_relays().await?; let find_relay = || { - for country in &countries { - for city in &country.cities { - for relay in &city.relays { - if relay.hostname == hostname { - return Some((country, city, relay)); + for country in countries { + for city in country.cities { + for relay in city.relays { + if relay.hostname.to_lowercase() == hostname.to_lowercase() { + return Some(types::RelayLocation { + country: country.code, + city: city.code, + hostname: relay.hostname, + }); } } } @@ -408,19 +412,13 @@ impl Relay { if let Some(location) = find_relay() { println!( "Setting location constraint to {} in {}, {}", - location.2.hostname, location.1.name, location.0.name + location.hostname, location.city, location.country ); - let location_constraint = types::RelayLocation { - country: location.0.code.clone(), - city: location.1.code.clone(), - hostname: location.2.hostname.clone(), - }; - self.update_constraints(types::RelaySettingsUpdate { r#type: Some(types::relay_settings_update::Type::Normal( types::NormalRelaySettingsUpdate { - location: Some(location_constraint), + location: Some(location), ..Default::default() }, )), |
