diff options
| -rw-r--r-- | mullvad-api/src/lib.rs | 2 | ||||
| -rw-r--r-- | mullvad-api/src/rest.rs | 11 |
2 files changed, 3 insertions, 10 deletions
diff --git a/mullvad-api/src/lib.rs b/mullvad-api/src/lib.rs index 26c6d3f71d..6d9a91b4ae 100644 --- a/mullvad-api/src/lib.rs +++ b/mullvad-api/src/lib.rs @@ -341,7 +341,7 @@ impl Runtime { ) .await; let token_store = access::AccessTokenStore::new(service.clone()); - let factory = rest::RequestFactory::new(API.host.clone(), None, Some(token_store)); + let factory = rest::RequestFactory::new(API.host.clone(), Some(token_store)); rest::MullvadRestHandle::new( service, diff --git a/mullvad-api/src/rest.rs b/mullvad-api/src/rest.rs index 1a1b2439c8..870032459e 100644 --- a/mullvad-api/src/rest.rs +++ b/mullvad-api/src/rest.rs @@ -482,20 +482,14 @@ struct NewErrorResponse { #[derive(Clone)] pub struct RequestFactory { hostname: String, - path_prefix: Option<String>, token_store: Option<AccessTokenStore>, pub timeout: Duration, } impl RequestFactory { - pub fn new( - hostname: String, - path_prefix: Option<String>, - token_store: Option<AccessTokenStore>, - ) -> Self { + pub fn new(hostname: String, token_store: Option<AccessTokenStore>) -> Self { Self { hostname, - path_prefix, token_store, timeout: DEFAULT_TIMEOUT, } @@ -572,8 +566,7 @@ impl RequestFactory { } fn get_uri(&self, path: &str) -> Result<Uri> { - let prefix = self.path_prefix.as_ref().map(AsRef::as_ref).unwrap_or(""); - let uri = format!("https://{}/{}{}", self.hostname, prefix, path); + let uri = format!("https://{}/{}", self.hostname, path); hyper::Uri::from_str(&uri).map_err(|_| Error::InvalidUri) } } |
