mirror of
https://github.com/redlib-org/redlib.git
synced 2025-04-20 13:59:15 +00:00
fix: handle case insensitivity for subs
Some checks failed
Release Build / Rust project - latest (push) Has been cancelled
Rust Build & Publish / build (push) Has been cancelled
Pull Request / cargo test (push) Has been cancelled
Pull Request / cargo fmt --all -- --check (push) Has been cancelled
Pull Request / cargo clippy -- -D warnings (push) Has been cancelled
Some checks failed
Release Build / Rust project - latest (push) Has been cancelled
Rust Build & Publish / build (push) Has been cancelled
Pull Request / cargo test (push) Has been cancelled
Pull Request / cargo fmt --all -- --check (push) Has been cancelled
Pull Request / cargo clippy -- -D warnings (push) Has been cancelled
This commit is contained in:
parent
f3ca7bb7d1
commit
d097495a41
1 changed files with 5 additions and 1 deletions
|
@ -71,9 +71,13 @@ pub async fn find(req: Request<Body>) -> Result<Response<Body>, 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..])));
|
||||
|
|
Loading…
Add table
Reference in a new issue