mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Tweaks for SITE_URL setup (#6602)
This commit is contained in:
parent
b192c44b61
commit
bf97804a0b
@ -994,6 +994,9 @@ ALLOWED_HOSTS = get_setting(
|
||||
typecast=list,
|
||||
)
|
||||
|
||||
if SITE_URL and SITE_URL not in ALLOWED_HOSTS:
|
||||
ALLOWED_HOSTS.append(SITE_URL)
|
||||
|
||||
# List of trusted origins for unsafe requests
|
||||
# Ref: https://docs.djangoproject.com/en/4.2/ref/settings/#csrf-trusted-origins
|
||||
CSRF_TRUSTED_ORIGINS = get_setting(
|
||||
@ -1004,7 +1007,7 @@ CSRF_TRUSTED_ORIGINS = get_setting(
|
||||
)
|
||||
|
||||
# If a list of trusted is not specified, but a site URL has been specified, use that
|
||||
if SITE_URL and len(CSRF_TRUSTED_ORIGINS) == 0:
|
||||
if SITE_URL and SITE_URL not in CSRF_TRUSTED_ORIGINS:
|
||||
CSRF_TRUSTED_ORIGINS.append(SITE_URL)
|
||||
|
||||
USE_X_FORWARDED_HOST = get_boolean_setting(
|
||||
@ -1045,7 +1048,7 @@ CORS_ALLOWED_ORIGINS = get_setting(
|
||||
)
|
||||
|
||||
# If no CORS origins are specified, but a site URL has been specified, use that
|
||||
if SITE_URL and len(CORS_ALLOWED_ORIGINS) == 0:
|
||||
if SITE_URL and SITE_URL not in CORS_ALLOWED_ORIGINS:
|
||||
CORS_ALLOWED_ORIGINS.append(SITE_URL)
|
||||
|
||||
for app in SOCIAL_BACKENDS:
|
||||
|
Loading…
Reference in New Issue
Block a user