aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel GarcĂ­a <[email protected]>2019-10-05 16:17:43 +0200
committerGitHub <[email protected]>2019-10-05 16:17:43 +0200
commitc182583e09fc94cdc8127fcb04f6fe2b05f8443a (patch)
treea22bd919098f7cf79a95e4e83fbc0ffd1f14ef59
parentd821389c2e838c1533bc9e1f5757a5c5719b05e0 (diff)
parentbe2916333b7db2837c8f0ce2367ff3996c11d781 (diff)
downloadvaultwarden-c182583e09fc94cdc8127fcb04f6fe2b05f8443a.tar.gz
vaultwarden-c182583e09fc94cdc8127fcb04f6fe2b05f8443a.zip
Merge pull request #644 from BlackDex/issue-565
Fixed issue #565
-rw-r--r--src/api/icons.rs20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/api/icons.rs b/src/api/icons.rs
index 39475d07..86747933 100644
--- a/src/api/icons.rs
+++ b/src/api/icons.rs
@@ -253,12 +253,20 @@ fn get_page(url: &str) -> Result<Response, Error> {
}
fn get_page_with_cookies(url: &str, cookie_str: &str) -> Result<Response, Error> {
- CLIENT
- .get(url)
- .header("cookie", cookie_str)
- .send()?
- .error_for_status()
- .map_err(Into::into)
+ if cookie_str.is_empty() {
+ CLIENT
+ .get(url)
+ .send()?
+ .error_for_status()
+ .map_err(Into::into)
+ } else {
+ CLIENT
+ .get(url)
+ .header("cookie", cookie_str)
+ .send()?
+ .error_for_status()
+ .map_err(Into::into)
+ }
}
/// Returns a Integer with the priority of the type of the icon which to prefer.