From c0426d57103cf805bb27fbbdedf213d5af510771 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sun, 28 Jan 2024 11:14:28 +0800 Subject: [PATCH] bugfix --- ahserver/auth_api.py | 6 +++--- ahserver/configuredServer.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ahserver/auth_api.py b/ahserver/auth_api.py index 5b8e2c2..90857a4 100755 --- a/ahserver/auth_api.py +++ b/ahserver/auth_api.py @@ -80,9 +80,9 @@ class AuthAPI(AppLogger): async def setupAuth(self,app): # setup session middleware in aiohttp fashion - secret = b'iqwertyuiopasdfghjklzxcvbnm12345' - if self.conf.website.cookie_secret: - secret = self.conf.website.cookie_secret.encode('utf-8') + b = str(self.conf.website.port).encode('utf-8') + cnt = 32 - len(b) + secret = b + b'iqwertyuiopasdfghjklzxcvbnm12345'[:cnt] storage = EncryptedCookieStorage(secret) if self.conf.website.session_redis: url = self.conf.website.session_redis.url diff --git a/ahserver/configuredServer.py b/ahserver/configuredServer.py index 0dba6ef..962eb29 100755 --- a/ahserver/configuredServer.py +++ b/ahserver/configuredServer.py @@ -60,7 +60,7 @@ class ConfiguredServer(AppLogger): config.website.ssl.keyfile) reuse_port = None if platform != 'win32': - resue_port = True + reuse_port = True web.run_app(self.init_auth(),host=config.website.host or '0.0.0.0', port=port, reuse_port=reuse_port,