From e0463420fa21febe21af671aaf8310ae21388bf0 Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 10 Aug 2023 11:23:42 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20core=20=E5=88=B0=20allow=20hosts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/jumpserver/settings/base.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/jumpserver/settings/base.py b/apps/jumpserver/settings/base.py index 7498b1a33..dabe34c7c 100644 --- a/apps/jumpserver/settings/base.py +++ b/apps/jumpserver/settings/base.py @@ -78,7 +78,7 @@ ALLOWED_DOMAINS = [host.strip() for host in ALLOWED_DOMAINS] ALLOWED_DOMAINS = [host.replace('http://', '').replace('https://', '') for host in ALLOWED_DOMAINS if host] ALLOWED_DOMAINS = [host.split('/')[0] for host in ALLOWED_DOMAINS if host] -DEBUG_HOSTS = ('127.0.0.1', 'localhost') +DEBUG_HOSTS = ('127.0.0.1', 'localhost', 'core') DEBUG_PORT = ['8080', '80', ] if DEBUG: DEBUG_PORT.extend(['4200', '9528']) @@ -88,7 +88,7 @@ ALLOWED_DOMAINS.extend(DEBUG_HOST_PORTS) ALLOWED_HOSTS = list(set(['.' + host.split(':')[0] for host in ALLOWED_DOMAINS])) print("ALLOWED_HOSTS: ", ) for host in ALLOWED_HOSTS: - print(' - ' + host) + print(' - ' + host.lstrip('.')) # https://docs.djangoproject.com/en/4.1/ref/settings/#std-setting-CSRF_TRUSTED_ORIGINS CSRF_TRUSTED_ORIGINS = [] @@ -103,9 +103,9 @@ for host_port in ALLOWED_DOMAINS: continue CSRF_TRUSTED_ORIGINS.append('{}://*.{}'.format(schema, origin)) -print("CSRF_TRUSTED_ORIGINS: ") -for origin in CSRF_TRUSTED_ORIGINS: - print(' - ' + origin) +# print("CSRF_TRUSTED_ORIGINS: ") +# for origin in CSRF_TRUSTED_ORIGINS: +# print(' - ' + origin) # Max post update field num DATA_UPLOAD_MAX_NUMBER_FIELDS = 10000