base64: be a tolerant reader

This commit is contained in:
Mikaël Cluseau
2026-02-10 21:23:11 +01:00
parent 723cecff1b
commit d2293df011
2 changed files with 8 additions and 2 deletions

View File

@@ -81,3 +81,8 @@ impl Config {
self.files.iter().find(|f| f.path == path)
}
}
pub fn base64_decode(s: &str) -> Result<Vec<u8>, base64::DecodeError> {
use base64::{prelude::BASE64_STANDARD_NO_PAD as B64, Engine};
B64.decode(s.trim_end_matches('='))
}