File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
infrastructure/modules/container-apps Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ module "webapp" {
2424 environment_variables = merge (
2525 local. common_env ,
2626 {
27- ALLOWED_HOSTS = " ${ var . app_short_name } -web-${ var . environment } .${ var . default_domain } "
27+ ALLOWED_HOSTS = " ${ var . app_short_name } -web-${ var . environment } .${ var . default_domain } "
28+ CSRF_TRUSTED_ORIGINS = " https://${ var . app_short_name } -web-${ var . environment } .${ var . default_domain } "
2829 },
2930 var. deploy_database_as_container ? local. container_db_env : local. azure_db_env
3031 )
Original file line number Diff line number Diff line change @@ -19,6 +19,11 @@ def boolean_env(key, default=None):
1919 value = environ .get (key )
2020 return default if value is None else value in ("True" , "true" , "1" )
2121
22+ def list_env (key ):
23+ value = environ .get (key )
24+ return value .split ("," ) if value else []
25+
26+
2227# Build paths inside the project like this: BASE_DIR / 'subdir'.
2328BASE_DIR = Path (__file__ ).resolve ().parent
2429
@@ -32,9 +37,8 @@ def boolean_env(key, default=None):
3237# SECURITY WARNING: don't run with debug turned on in production!
3338DEBUG = boolean_env ("DEBUG" , default = False )
3439
35- allowed_hosts = environ .get ("ALLOWED_HOSTS" )
36- ALLOWED_HOSTS = allowed_hosts .split ("," ) if allowed_hosts else []
37-
40+ ALLOWED_HOSTS = list_env ("ALLOWED_HOSTS" )
41+ CSRF_TRUSTED_ORIGINS = list_env ("CSRF_TRUSTED_ORIGINS" )
3842
3943# Application definition
4044
You can’t perform that action at this time.
0 commit comments