Remove port from ALLOWED_HOST entries (#6871)

This commit is contained in:
Oliver 2024-03-27 23:23:15 +11:00 committed by GitHub
parent c2a9b0252a
commit ffd1229714
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1017,7 +1017,10 @@ if not ALLOWED_HOSTS:
# Ensure that the ALLOWED_HOSTS do not contain any scheme info # Ensure that the ALLOWED_HOSTS do not contain any scheme info
for i, host in enumerate(ALLOWED_HOSTS): for i, host in enumerate(ALLOWED_HOSTS):
if '://' in host: if '://' in host:
ALLOWED_HOSTS[i] = host.split('://')[1] ALLOWED_HOSTS[i] = host = host.split('://')[1]
if ':' in host:
ALLOWED_HOSTS[i] = host = host.split(':')[0]
# List of trusted origins for unsafe requests # List of trusted origins for unsafe requests
# Ref: https://docs.djangoproject.com/en/4.2/ref/settings/#csrf-trusted-origins # Ref: https://docs.djangoproject.com/en/4.2/ref/settings/#csrf-trusted-origins