From 95c29fd68cda5748d4e1cb3f02c5c7a0b202454b Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 18 Apr 2021 00:08:46 -0400 Subject: avoid generating urls with double slashes apparently the official bitwarden server doesn't like it --- src/config.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/config.rs b/src/config.rs index dbdf759..c6e0787 100644 --- a/src/config.rs +++ b/src/config.rs @@ -126,7 +126,7 @@ impl Config { pub fn base_url(&self) -> String { self.base_url.clone().map_or_else( || "https://api.bitwarden.com".to_string(), - |url| format!("{}/api", url), + |url| format!("{}/api", url.trim_end_matches('/')), ) } @@ -134,7 +134,7 @@ impl Config { self.identity_url.clone().unwrap_or_else(|| { self.base_url.clone().map_or_else( || "https://identity.bitwarden.com".to_string(), - |url| format!("{}/identity", url), + |url| format!("{}/identity", url.trim_end_matches('/')), ) }) } -- cgit v1.2.3-54-g00ecf