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
remotes/1693045480750635534/spooky-22
Maximilian Ballard 2022-08-02 19:09:35 -04:00 committed by GitHub
parent 5aff344efe
commit 3c506d768c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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('/')
return redirect('/')