diff options
| author | David Lönnhager <david.l@mullvad.net> | 2025-08-18 09:02:21 +0200 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2025-08-18 10:51:58 +0200 |
| commit | ba966fee57d9de61997bef4d7dcf6539af26c037 (patch) | |
| tree | 3299982d13cfd1a53f7166257a9af1fc1e8469d9 /mullvad-api | |
| parent | 0abee355c21eb00a221842b39ab41bc26fa0b663 (diff) | |
| download | mullvadvpn-ba966fee57d9de61997bef4d7dcf6539af26c037.tar.xz mullvadvpn-ba966fee57d9de61997bef4d7dcf6539af26c037.zip | |
Fail if QUIC address set is empty
Diffstat (limited to 'mullvad-api')
| -rw-r--r-- | mullvad-api/Cargo.toml | 1 | ||||
| -rw-r--r-- | mullvad-api/src/relay_list.rs | 10 |
2 files changed, 8 insertions, 3 deletions
diff --git a/mullvad-api/Cargo.toml b/mullvad-api/Cargo.toml index 5764d9378b..1ffd0bc08c 100644 --- a/mullvad-api/Cargo.toml +++ b/mullvad-api/Cargo.toml @@ -47,6 +47,7 @@ tokio-rustls = { version = "0.26.0", features = [ tokio-socks = "0.5.1" rustls-pemfile = "2.1.3" uuid = { version = "1.4.1", features = ["v4"] } +vec1 = { workspace = true, features = ["serde"] } mullvad-api-constants = { path = "./mullvad-api-constants" } mullvad-encrypted-dns-proxy = { path = "../mullvad-encrypted-dns-proxy" } diff --git a/mullvad-api/src/relay_list.rs b/mullvad-api/src/relay_list.rs index 28ce37aec0..6fdc073efd 100644 --- a/mullvad-api/src/relay_list.rs +++ b/mullvad-api/src/relay_list.rs @@ -5,6 +5,7 @@ use crate::rest; use hyper::{StatusCode, body::Incoming, header}; use mullvad_types::{location, relay_list}; use talpid_types::net::wireguard; +use vec1::Vec1; use std::{ collections::{BTreeMap, HashSet}, @@ -386,9 +387,12 @@ struct Daita {} struct Quic { /// In-addresses for the QUIC obfuscator. /// - /// There may be 0, 1 or 2 in IPs, depending on how many masque-proxy daemons running on the - /// relay. Hopefully the API will tell use the correct amount🤞. - addr_in: Vec<IpAddr>, + /// # Note + /// + /// This set must be non-empty. + /// + /// The primary IPs of the relay will be included if and only if they are listed here. + addr_in: Vec1<IpAddr>, /// Authorization token token: String, /// Hostname where masque proxy is hosted |
