From f3ca7bb7d1f03d4eb1e19be5f1bb1b66b4c25f89 Mon Sep 17 00:00:00 2001 From: Matthew Esposito Date: Thu, 27 Feb 2025 14:35:09 -0500 Subject: [PATCH] feat: allow for case-insensitive search redirects (fix #389) --- src/search.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/search.rs b/src/search.rs index 5962c2e..bf3e65b 100644 --- a/src/search.rs +++ b/src/search.rs @@ -71,11 +71,11 @@ pub async fn find(req: Request) -> Result, String> { return Ok(redirect("/")); } - if query.starts_with("r/") || query.starts_with("user/") { + if query.starts_with("r/") || query.starts_with("R/") || query.starts_with("user/") { return Ok(redirect(&format!("/{query}"))); } - if query.starts_with("u/") { + if query.starts_with("u/") || query.starts_with("U/") { return Ok(redirect(&format!("/user{}", &query[1..]))); }