From b4391b55f23ecf577bdd5adc162f9e81b8777261 Mon Sep 17 00:00:00 2001 From: Bat Date: Sun, 9 Sep 2018 11:53:22 +0100 Subject: [PATCH] Fix panic because of invalid URL parsing when commenting --- src/routes/comments.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/comments.rs b/src/routes/comments.rs index e751ecbc..f896e703 100644 --- a/src/routes/comments.rs +++ b/src/routes/comments.rs @@ -47,7 +47,7 @@ fn create(blog_name: String, slug: String, data: LenientForm, us let user_clone = user.clone(); worker.execute(Thunk::of(move || broadcast(&user_clone, new_comment, followers))); - Redirect::to(format!("/~/{}/{}/#comment-{}", blog_name, slug, id)) + Redirect::to(format!(uri!(super::posts::details: blog_name = blog_name, slug = slug)) }) .map_err(|errors| { // TODO: de-duplicate this code @@ -69,5 +69,5 @@ fn create(blog_name: String, slug: String, data: LenientForm, us "user_fqn": user.get_fqn(&*conn), "errors": errors })) - }) + }) }