1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-05-25 21:13:57 +00:00

Updated dependencies and fixed panic getting icons

This commit is contained in:
Daniel García 2019-07-30 19:38:54 +02:00
parent 8a21c6df10
commit c9c3f07171
No known key found for this signature in database
GPG key ID: FC8A7D14C3CD543A
4 changed files with 351 additions and 303 deletions

View file

@ -204,9 +204,13 @@ fn get_icon_url(domain: &str) -> Result<(Vec<Icon>, String), Error> {
let raw_cookies = content.headers().get_all("set-cookie");
cookie_str = raw_cookies
.iter()
.map(|raw_cookie| {
let cookie = Cookie::parse(raw_cookie.to_str().unwrap_or_default()).unwrap();
format!("{}={}; ", cookie.name(), cookie.value())
.filter_map(|raw_cookie| raw_cookie.to_str().ok())
.map(|cookie_str| {
if let Ok(cookie) = Cookie::parse(cookie_str) {
format!("{}={}; ", cookie.name(), cookie.value())
} else {
String::new()
}
})
.collect::<String>();

View file

@ -3,7 +3,7 @@ use lettre::smtp::ConnectionReuseParameters;
use lettre::{ClientSecurity, ClientTlsParameters, SmtpClient, SmtpTransport, Transport};
use lettre_email::{EmailBuilder, MimeMultipartType, PartBuilder};
use native_tls::{Protocol, TlsConnector};
use percent_encoding::{percent_encode, DEFAULT_ENCODE_SET};
use percent_encoding::{percent_encode, NON_ALPHANUMERIC};
use quoted_printable::encode_to_str;
use crate::api::EmptyResult;
@ -103,7 +103,7 @@ pub fn send_invite(
"url": CONFIG.domain(),
"org_id": org_id.unwrap_or_else(|| "_".to_string()),
"org_user_id": org_user_id.unwrap_or_else(|| "_".to_string()),
"email": percent_encode(address.as_bytes(), DEFAULT_ENCODE_SET).to_string().replace("+", "%2b"),
"email": percent_encode(address.as_bytes(), NON_ALPHANUMERIC).to_string(),
"org_name": org_name,
"token": invite_token,
}),