Skip to content

Commit d097495

Browse files
committed
fix: handle case insensitivity for subs
1 parent f3ca7bb commit d097495

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/search.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,13 @@ pub async fn find(req: Request<Body>) -> Result<Response<Body>, String> {
7171
return Ok(redirect("/"));
7272
}
7373

74-
if query.starts_with("r/") || query.starts_with("R/") || query.starts_with("user/") {
74+
if query.starts_with("r/") || query.starts_with("user/") {
7575
return Ok(redirect(&format!("/{query}")));
7676
}
77+
78+
if query.starts_with("R/") {
79+
return Ok(redirect(&format!("/r{}", &query[1..])));
80+
}
7781

7882
if query.starts_with("u/") || query.starts_with("U/") {
7983
return Ok(redirect(&format!("/user{}", &query[1..])));

0 commit comments

Comments
 (0)