aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlackDex <[email protected]>2019-01-31 17:58:03 +0100
committerBlackDex <[email protected]>2019-01-31 17:58:03 +0100
commitbc461d9baa13911343a601c2dbe1791cfa01cc4d (patch)
tree8ffa191926d868a8f7601f17a9c94978c2196b40
parent5016e30cf298834f45af7abfd4811d2d70868e34 (diff)
downloadvaultwarden-bc461d9baa13911343a601c2dbe1791cfa01cc4d.tar.gz
vaultwarden-bc461d9baa13911343a601c2dbe1791cfa01cc4d.zip
Some small changes on the iter of the cookies
-rw-r--r--src/api/icons.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/api/icons.rs b/src/api/icons.rs
index 8ae3c83f..4fda717b 100644
--- a/src/api/icons.rs
+++ b/src/api/icons.rs
@@ -167,10 +167,10 @@ fn get_icon_url(domain: &str) -> Result<(String, String), Error> {
// Extract the URL from the respose in case redirects occured (like @ gitlab.com)
let url = content.url().clone();
let raw_cookies = content.headers().get_all("set-cookie");
- raw_cookies.iter().for_each(|raw_cookie| {
+ cookie_str = raw_cookies.iter().map(|raw_cookie| {
let cookie = Cookie::parse(raw_cookie.to_str().unwrap_or_default()).unwrap();
- cookie_str.push_str(&format!("{}={}; ", cookie.name(), cookie.value()));
- });
+ format!("{}={}; ", cookie.name(), cookie.value())
+ }).collect::<String>();
// Add the default favicon.ico to the list with the domain the content responded from.
iconlist.push(IconList { priority: 35, href: url.join("/favicon.ico").unwrap().into_string() });