From 3c506d768c4baad463e702af06f6151218989c31 Mon Sep 17 00:00:00 2001 From: Maximilian Ballard <22283158+ediw8311xht@users.noreply.github.com> Date: Tue, 2 Aug 2022 19:09:35 -0400 Subject: [PATCH] Redirect cuts off end of url for username redirect (#326) * Redirect cuts off end of url for username redirect username redirect cuts off end of url, For example: Username: faygo_sucks Old_username: geese_suck Behavior: "https://rdrama.net/@geese_suck" -> "https://rdrama.net/@faygo_suck" Expected Behavior: "https://rdrama.net/@geese_suck" -> "https://rdrama.net/@faygo_sucks" * Update users.py --- files/routes/users.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/users.py b/files/routes/users.py index fd2e06c93..6502ea2d6 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -922,7 +922,7 @@ def u_username(username, v=None): if username != u.username: - return redirect(SITE_FULL + request.full_path.replace(username, u.username)[:-1]) + return redirect(SITE_FULL + request.full_path.replace(username, u.username)) if u.reserved: if request.headers.get("Authorization") or request.headers.get("xhr") or request.path.endswith(".json"): @@ -1321,4 +1321,4 @@ def toggle_pins(sort): if is_site_url(request.referrer): return redirect(request.referrer) - return redirect('/') \ No newline at end of file + return redirect('/')