summaryrefslogtreecommitdiff
path: root/src/auth.rs
diff options
context:
space:
mode:
authorMathijs van Veluw <[email protected]>2024-04-06 13:55:10 +0200
committerGitHub <[email protected]>2024-04-06 13:55:10 +0200
commite42a37c6c12bf7d51dd33ff7b6f000f4be6c8384 (patch)
tree7206b45123512b480901520b82df2bac42587b93 /src/auth.rs
parent129b835ac7eaedba00c3aafcdaff2bbe263aaf2f (diff)
downloadvaultwarden-e42a37c6c12bf7d51dd33ff7b6f000f4be6c8384.tar.gz
vaultwarden-e42a37c6c12bf7d51dd33ff7b6f000f4be6c8384.zip
Update crates and some Clippy fixes (#4475)
- Updated all crates including reqwest - Fixed some clippy lints reported by nightly Rust
Diffstat (limited to 'src/auth.rs')
-rw-r--r--src/auth.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/auth.rs b/src/auth.rs
index 3d5be269..3f92be76 100644
--- a/src/auth.rs
+++ b/src/auth.rs
@@ -4,7 +4,7 @@ use chrono::{TimeDelta, Utc};
use num_traits::FromPrimitive;
use once_cell::sync::{Lazy, OnceCell};
-use jsonwebtoken::{self, errors::ErrorKind, Algorithm, DecodingKey, EncodingKey, Header};
+use jsonwebtoken::{errors::ErrorKind, Algorithm, DecodingKey, EncodingKey, Header};
use openssl::rsa::Rsa;
use serde::de::DeserializeOwned;
use serde::ser::Serialize;
@@ -391,10 +391,8 @@ impl<'r> FromRequest<'r> for Host {
let host = if let Some(host) = headers.get_one("X-Forwarded-Host") {
host
- } else if let Some(host) = headers.get_one("Host") {
- host
} else {
- ""
+ headers.get_one("Host").unwrap_or_default()
};
format!("{protocol}://{host}")