From 72f7d9d08c484e43806a66d488e0e77ef16a4f80 Mon Sep 17 00:00:00 2001 From: Matthew Esposito Date: Tue, 24 Sep 2024 23:20:12 -0400 Subject: [PATCH] fix(search): handle multi-sub search (#263) --- src/search.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/search.rs b/src/search.rs index 2b25983..6c8c173 100644 --- a/src/search.rs +++ b/src/search.rs @@ -60,7 +60,8 @@ pub async fn find(req: Request) -> Result, String> { } else { "" }; - let path = format!("{}.json?{}{}&raw_json=1", req.uri().path(), req.uri().query().unwrap_or_default(), nsfw_results); + let uri_path = req.uri().path().replace("+", "%2B"); + let path = format!("{}.json?{}{}&raw_json=1", uri_path, req.uri().query().unwrap_or_default(), nsfw_results); let mut query = param(&path, "q").unwrap_or_default(); query = REDDIT_URL_MATCH.replace(&query, "").to_string();