fix broken PREFIX_URL feature

This commit is contained in:
Alex
2019-12-06 14:16:19 +02:00
parent 6d6ef97826
commit 91cee0339a
6 changed files with 34 additions and 12 deletions

View File

@@ -22,6 +22,8 @@ class Config:
def __init__(self):
for k, v in self._DEFAULTS.items():
setattr(self, k, os.environ[k] if k in os.environ else v)
if not self.URL_PREFIX.endswith('/'):
self.URL_PREFIX += '/'
config = Config()
@@ -35,10 +37,8 @@ class ObjectSerializer(json.JSONEncoder):
serializer = ObjectSerializer()
app = web.Application()
sio = socketio.AsyncServer()
sio.attach(app)
sio.attach(app, socketio_path=config.URL_PREFIX + 'socket.io')
routes = web.RouteTableDef()
if not config.URL_PREFIX.endswith('/'):
config.URL_PREFIX += '/'
class Notifier(DownloadQueueNotifier):
async def added(self, dl):