Fix Regex matching of Reddit links

This commit is contained in:
spikecodes 2021-07-17 22:24:28 -07:00
parent ee51ce1a76
commit a190890239
No known key found for this signature in database
GPG key ID: 004CECFF9B463BCB
4 changed files with 4 additions and 4 deletions

View file

@ -251,7 +251,7 @@ async fn main() {
app.at("/:id").get(|req: Request<Body>| match req.param("id").as_deref() {
// Sort front page
Some("best") | Some("hot") | Some("new") | Some("top") | Some("rising") | Some("controversial") => subreddit::community(req).boxed(),
Some("best" | "hot" | "new" | "top" | "rising" | "controversial") => subreddit::community(req).boxed(),
// Short link for post
Some(id) if id.len() > 4 && id.len() < 7 => post::item(req).boxed(),
// Error message for unknown pages