From a301f1ecb62dff3724247fd074cb45911a65fcc1 Mon Sep 17 00:00:00 2001 From: spikecodes <19519553+spikecodes@users.noreply.github.com> Date: Sat, 30 Jan 2021 17:38:47 -0800 Subject: [PATCH] Simplify redirect path --- src/subreddit.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/subreddit.rs b/src/subreddit.rs index 0a774e3..3e4eba2 100644 --- a/src/subreddit.rs +++ b/src/subreddit.rs @@ -99,7 +99,7 @@ pub async fn subscriptions(req: HttpRequest) -> HttpResponse { // Redirect back to subreddit // check for redirect parameter if unsubscribing from outside sidebar - let redirect_path = param(&format!("{}?{}", req.path(), req.query_string()), "redirect"); + let redirect_path = param(&req.uri().to_string(), "redirect"); let path; if redirect_path.len() > 1 && redirect_path.chars().nth(0).unwrap() == '/' {