summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2023-10-21 15:30:28 +0200
committerDavid Lönnhager <david.l@mullvad.net>2023-10-30 23:15:25 +0100
commitab1fd371adae5c3c5afe73daf0fe43c30d79ef88 (patch)
tree6744681fdda893e95f5e9d6bc244b7e0c913002c
parent047e542f513ec05489200d8731a9bc7045854719 (diff)
downloadmullvadvpn-ab1fd371adae5c3c5afe73daf0fe43c30d79ef88.tar.xz
mullvadvpn-ab1fd371adae5c3c5afe73daf0fe43c30d79ef88.zip
Remove unused URL component
-rw-r--r--mullvad-api/src/lib.rs2
-rw-r--r--mullvad-api/src/rest.rs11
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)
}
}