1
0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2024-11-09 20:42:36 +01:00

Merge pull request #3376 from jjlin/knowndevices-nopad

Decode knowndevice `X-Request-Email` as base64url with no padding
This commit is contained in:
Daniel García 2023-03-27 09:32:25 +02:00 committed by GitHub
commit 525e6bb65a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -899,7 +899,7 @@ impl<'r> FromRequest<'r> for KnownDevice {
async fn from_request(req: &'r Request<'_>) -> Outcome<Self, Self::Error> {
let email = if let Some(email_b64) = req.headers().get_one("X-Request-Email") {
let email_bytes = match data_encoding::BASE64URL.decode(email_b64.as_bytes()) {
let email_bytes = match data_encoding::BASE64URL_NOPAD.decode(email_b64.as_bytes()) {
Ok(bytes) => bytes,
Err(_) => {
return Outcome::Failure((