Strip HTTP root on login redirect

This commit is contained in:
JonnyWong16 2021-01-29 10:32:44 -08:00
parent 6a534ade9f
commit 5b5ccee23b
No known key found for this signature in database
GPG key ID: B1F1F9807184697A

View file

@ -422,4 +422,7 @@ class AuthController(object):
@cherrypy.expose @cherrypy.expose
def redirect(self, redirect_uri='', *args, **kwargs): 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('/')) raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT + redirect_uri.strip('/'))