feat(search): redirect u/ and user/ to profile (#268)
This commit is contained in:
parent
fe4fed0504
commit
8d0ed4682e
@ -69,10 +69,14 @@ pub async fn find(req: Request<Body>) -> Result<Response<Body>, String> {
|
||||
return Ok(redirect("/"));
|
||||
}
|
||||
|
||||
if query.starts_with("r/") {
|
||||
if query.starts_with("r/") || query.starts_with("user/") {
|
||||
return Ok(redirect(&format!("/{query}")));
|
||||
}
|
||||
|
||||
if query.starts_with("u/") {
|
||||
return Ok(redirect(&format!("/user{}", &query[1..])));
|
||||
}
|
||||
|
||||
let sub = req.param("sub").unwrap_or_default();
|
||||
let quarantined = can_access_quarantine(&req, &sub);
|
||||
// Handle random subreddits
|
||||
|
Loading…
Reference in New Issue
Block a user