From 6cf374864263132912ea8fcf7a864619d1382cd2 Mon Sep 17 00:00:00 2001 From: elliot <75391956+ellieeet123@users.noreply.github.com> Date: Sun, 1 Jan 2023 17:06:58 -0600 Subject: [PATCH] Fix for #675 /:id route now accepts 7 character post IDs. --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 3b45bd2..25c2aea 100644 --- a/src/main.rs +++ b/src/main.rs @@ -289,7 +289,7 @@ async fn main() { Some("best" | "hot" | "new" | "top" | "rising" | "controversial") => subreddit::community(req).await, // Short link for post - Some(id) if (5..7).contains(&id.len()) => match canonical_path(format!("/{}", id)).await { + Some(id) if (5..8).contains(&id.len()) => match canonical_path(format!("/{}", id)).await { Ok(path_opt) => match path_opt { Some(path) => Ok(redirect(path)), None => error(req, "Post ID is invalid. It may point to a post on a community that has been banned.").await,