From d55a6c181b08208c9170d33aa8d9e8b0aed062b5 Mon Sep 17 00:00:00 2001 From: traxys Date: Sat, 29 Jul 2023 10:59:17 +0200 Subject: [PATCH] Add padding to the base64 string --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index e4b2714..8975a72 100644 --- a/src/main.rs +++ b/src/main.rs @@ -33,7 +33,7 @@ impl std::fmt::Debug for Base64 { write!( f, r#"b64"{}""#, - &general_purpose::STANDARD_NO_PAD.encode(self.0.to_bytes()) + &general_purpose::STANDARD.encode(self.0.to_bytes()) ) } } @@ -43,7 +43,7 @@ impl Serialize for Base64 { where S: Serializer, { - ser.serialize_str(&general_purpose::STANDARD_NO_PAD.encode(self.0.to_bytes())) + ser.serialize_str(&general_purpose::STANDARD.encode(self.0.to_bytes())) } } @@ -66,7 +66,7 @@ impl<'de> Deserialize<'de> for Base64 { where E: serde::de::Error, { - general_purpose::STANDARD_NO_PAD + general_purpose::STANDARD .decode(v) .map_err(E::custom) .map(|b| HS256Key::from_bytes(&b))