fix(tokens): fixing token encoding

Giving up on doing any kind of base64 encoding on the tokens
This commit is contained in:
Scott Lyons 2024-08-11 13:40:19 -07:00
commit 8eaad5b765

View file

@ -143,11 +143,11 @@ impl QueryToken {
impl Display for QueryToken { impl Display for QueryToken {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let suffix = if !self.value.is_empty() { let suffix = if !self.value.is_empty() {
format!(":{}", encode(&self.value)) format!(":{}", &self.value)
} else { } else {
"".to_string() "".to_string()
}; };
write!(f, "{}{}", encode(&self.key), suffix) write!(f, "{}{}", &self.key, suffix)
} }
} }
@ -609,9 +609,6 @@ mod tests {
QueryToken::sort(PostSortToken::Random), QueryToken::sort(PostSortToken::Random),
]; ];
assert_eq!( assert_eq!(query_vec.to_query_string(), "comment-count:1 sort:random");
query_vec.to_query_string(),
"comment-count%3A1%20sort%3Arandom"
);
} }
} }