summaryrefslogtreecommitdiffhomepage
path: root/mullvad-api/src/address_cache.rs
diff options
context:
space:
mode:
authorMarkus Pettersson <markus.pettersson@mullvad.net>2024-01-09 10:41:08 +0100
committerMarkus Pettersson <markus.pettersson@mullvad.net>2024-01-11 09:18:26 +0100
commit8b0fd0d971e67df8415da1bdac558e366bfd7290 (patch)
treee6b51f09eb39ca4a343c9d21880accb2903122f3 /mullvad-api/src/address_cache.rs
parent75eb89c820f12d488a76934f59ba29fe999cf59c (diff)
downloadmullvadvpn-8b0fd0d971e67df8415da1bdac558e366bfd7290.tar.xz
mullvadvpn-8b0fd0d971e67df8415da1bdac558e366bfd7290.zip
Synchronize `mullvad-api` and `mullvad-daemon` when the `api-override`
feature is enabled Move the logic for using overridden API endpoints for API calls from `mullvad-api::rest` to `mullvad_daemon::api`. This is in line with how the interaction between the two crates work for a normal release build, i.e. when the `api-override` feature is disabled. This commit also removes references to `force_direct_connection` in the Android code. The flag does not exist in the `mullvad-*` rust crates anymore, so it would be erroneous to try to serialize/deserialize the value from the Android client.
Diffstat (limited to 'mullvad-api/src/address_cache.rs')
-rw-r--r--mullvad-api/src/address_cache.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/mullvad-api/src/address_cache.rs b/mullvad-api/src/address_cache.rs
index e4bcf9bde7..ea93d96e26 100644
--- a/mullvad-api/src/address_cache.rs
+++ b/mullvad-api/src/address_cache.rs
@@ -31,7 +31,7 @@ pub struct AddressCache {
impl AddressCache {
/// Initialize cache using the hardcoded address, and write changes to `write_path`.
pub fn new(write_path: Option<Box<Path>>) -> Result<Self, Error> {
- Self::new_inner(API.addr, write_path)
+ Self::new_inner(API.address(), write_path)
}
/// Initialize cache using `read_path`, and write changes to `write_path`.
@@ -53,7 +53,7 @@ impl AddressCache {
/// Returns the address if the hostname equals `API.host`. Otherwise, returns `None`.
pub async fn resolve_hostname(&self, hostname: &str) -> Option<SocketAddr> {
- if hostname.eq_ignore_ascii_case(&API.host) {
+ if hostname.eq_ignore_ascii_case(API.host()) {
Some(self.get_address().await)
} else {
None