Redirect root to http_root

This commit is contained in:
JonnyWong16 2018-08-27 21:41:11 -07:00
parent ebc563fd26
commit e40483525b

View file

@ -202,6 +202,8 @@ def initialize(options):
# Prevent time-outs # Prevent time-outs
cherrypy.engine.timeout_monitor.unsubscribe() cherrypy.engine.timeout_monitor.unsubscribe()
cherrypy.tree.mount(WebInterface(), options['http_root'], config=conf) cherrypy.tree.mount(WebInterface(), options['http_root'], config=conf)
if plexpy.HTTP_ROOT != '/':
cherrypy.tree.mount(BaseRedirect(), '/')
try: try:
logger.info(u"Tautulli WebStart :: Starting Tautulli web server on %s://%s:%d%s", protocol, logger.info(u"Tautulli WebStart :: Starting Tautulli web server on %s://%s:%d%s", protocol,
@ -218,3 +220,9 @@ def initialize(options):
sys.exit(1) sys.exit(1)
cherrypy.server.wait() cherrypy.server.wait()
class BaseRedirect(object):
@cherrypy.expose
def index(self):
raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT)