From d097495a4182d0c9ba52ad9833171b2cab6d1a22 Mon Sep 17 00:00:00 2001 From: Matthew Esposito Date: Thu, 27 Feb 2025 20:10:01 -0500 Subject: [PATCH] fix: handle case insensitivity for subs --- src/search.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/search.rs b/src/search.rs index bf3e65b..1b5d1a9 100644 --- a/src/search.rs +++ b/src/search.rs @@ -71,9 +71,13 @@ pub async fn find(req: Request) -> Result, String> { return Ok(redirect("/")); } - if query.starts_with("r/") || query.starts_with("R/") || query.starts_with("user/") { + if query.starts_with("r/") || query.starts_with("user/") { return Ok(redirect(&format!("/{query}"))); } + + if query.starts_with("R/") { + return Ok(redirect(&format!("/r{}", &query[1..]))); + } if query.starts_with("u/") || query.starts_with("U/") { return Ok(redirect(&format!("/user{}", &query[1..])));