summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <faern@faern.net>2022-01-17 11:39:21 +0100
committerLinus Färnstrand <faern@faern.net>2022-01-17 11:44:50 +0100
commit80d2476c066813745947ee0e5a4b272f3cdb476b (patch)
tree3177fa6bc5da311765d759a64c8449aa32ca0e6e
parent1e9f7fcaa1a489b88e49faadf7ee4a3233426045 (diff)
downloadmullvadvpn-80d2476c066813745947ee0e5a4b272f3cdb476b.tar.xz
mullvadvpn-80d2476c066813745947ee0e5a4b272f3cdb476b.zip
Make `mullvad relay set hostname` not case sensitive to the input
-rw-r--r--CHANGELOG.md2
-rw-r--r--mullvad-cli/src/cmds/relay.rs24
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()
},
)),