fix: 优化替换 DOMAINS 中端口 的问题

pull/11945/head
ibuler 2023-10-23 11:09:00 +08:00 committed by Bryan
parent 1734ddc2bd
commit 6d2a62e413
1 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
import os import os
import platform import platform
import re
from redis.sentinel import SentinelManagedSSLConnection from redis.sentinel import SentinelManagedSSLConnection
@ -79,8 +80,8 @@ if CONFIG.SITE_URL:
ALLOWED_DOMAINS = DOMAINS.split(',') if DOMAINS else ['localhost:8080'] ALLOWED_DOMAINS = DOMAINS.split(',') if DOMAINS else ['localhost:8080']
ALLOWED_DOMAINS = [host.strip() for host in ALLOWED_DOMAINS] 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.replace('http://', '').replace('https://', '') for host in ALLOWED_DOMAINS if host]
ALLOWED_DOMAINS = [host.replace(':80', '').replace(':443', '') for host in ALLOWED_DOMAINS]
ALLOWED_DOMAINS = [host.split('/')[0] for host in ALLOWED_DOMAINS if host] ALLOWED_DOMAINS = [host.split('/')[0] for host in ALLOWED_DOMAINS if host]
ALLOWED_DOMAINS = [re.sub(':80$|:443$', '', host) for host in ALLOWED_DOMAINS]
DEBUG_HOSTS = ('127.0.0.1', 'localhost', 'core') DEBUG_HOSTS = ('127.0.0.1', 'localhost', 'core')
DEBUG_PORT = ['8080', '80', ] DEBUG_PORT = ['8080', '80', ]