Add padding to the base64 string
This commit is contained in:
parent
b6f809a92b
commit
d55a6c181b
1 changed files with 3 additions and 3 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue