From 4f64fc3a1328d735f44a00aee5b2fe6d2bc38def Mon Sep 17 00:00:00 2001 From: shockrah Date: Wed, 20 May 2020 01:21:01 -0700 Subject: [PATCH] utils::decode_params now uses the same config as utils::encode_params --- server/src/utils.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/utils.rs b/server/src/utils.rs index 05e0570..67d851b 100644 --- a/server/src/utils.rs +++ b/server/src/utils.rs @@ -5,13 +5,13 @@ use std::str; pub fn encode_param(raw: &str) -> String { - URL_SAFE.pad(false); let cfg = base64::Config::new(base64::CharacterSet::UrlSafe, false); encode_config(raw, cfg) } pub fn decode_param(enc: &str) -> Result { - let bytes = decode_config(enc, URL_SAFE).unwrap(); + let cfg = base64::Config::new(base64::CharacterSet::UrlSafe, false); + let bytes = decode_config(enc, cfg).unwrap(); let res = str::from_utf8(&bytes); match res { Ok(data) => Ok(data.into()),