From 5b5ccee23be3398dbbe85672d68bdaf6dcefe1bc Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Fri, 29 Jan 2021 10:32:44 -0800 Subject: [PATCH] Strip HTTP root on login redirect --- plexpy/webauth.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plexpy/webauth.py b/plexpy/webauth.py index 0b8cc510..d4d23707 100644 --- a/plexpy/webauth.py +++ b/plexpy/webauth.py @@ -422,4 +422,7 @@ class AuthController(object): @cherrypy.expose def redirect(self, redirect_uri='', *args, **kwargs): + root = plexpy.HTTP_ROOT.rstrip('/') + if redirect_uri.startswith(root): + redirect_uri = redirect_uri[len(root):] raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT + redirect_uri.strip('/'))