File tree Expand file tree Collapse file tree 4 files changed +10
-2
lines changed
infrastructure/environments
manage_breast_screening/config Expand file tree Collapse file tree 4 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ BASE_URL: https://dev.manage-breast-screening.non-live.screening.nhs.uk
22BASIC_AUTH_ENABLED : True
33CIS2_SERVER_METADATA_URL : https://am.nhsint.auth-ptl.cis2.spineservices.nhs.uk/openam/oauth2/realms/root/realms/NHSIdentity/realms/Healthcare/.well-known/openid-configuration
44PERSONAS_ENABLED : 1
5+ CSRF_TRUSTED_ORIGINS : ' https://dev.manage-breast-screening.non-live.screening.nhs.uk'
Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ BASE_URL: https://preprod.manage-breast-screening.screening.nhs.uk
22BASIC_AUTH_ENABLED : True
33CIS2_SERVER_METADATA_URL : https://am.nhsint.auth-ptl.cis2.spineservices.nhs.uk/openam/oauth2/realms/root/realms/NHSIdentity/realms/Healthcare/.well-known/openid-configuration
44PERSONAS_ENABLED : 1
5+ CSRF_TRUSTED_ORIGINS : ' https://preprod.manage-breast-screening.screening.nhs.uk'
Original file line number Diff line number Diff line change 11PERSONAS_ENABLED : 1
2+ CSRF_TRUSTED_ORIGINS : ' https://*.manage-breast-screening.non-live.screening.nhs.uk'
Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ def boolean_env(key, default=None):
2323 return default if value is None else value in ("True" , "true" , "1" )
2424
2525
26+ def list_env (key ):
27+ value = environ .get (key )
28+ return value .split ("," ) if value else []
29+
30+
2631# Build paths inside the project like this: BASE_DIR / 'subdir'.
2732BASE_DIR = Path (__file__ ).resolve ().parent .parent
2833
@@ -38,8 +43,8 @@ def boolean_env(key, default=None):
3843# SECURITY WARNING: don't run with debug turned on in production!
3944DEBUG = boolean_env ("DEBUG" , default = False )
4045
41- allowed_hosts = environ . get ("ALLOWED_HOSTS" )
42- ALLOWED_HOSTS = allowed_hosts . split ( "," ) if allowed_hosts else []
46+ ALLOWED_HOSTS = list_env ("ALLOWED_HOSTS" )
47+ CSRF_TRUSTED_ORIGINS = list_env ( "CSRF_TRUSTED_ORIGINS" )
4348
4449allowed_hosts_except_localhost = set (ALLOWED_HOSTS ) - {"localhost" , "127.0.0.1" }
4550
You can’t perform that action at this time.
0 commit comments