Skip to content

Commit

Permalink
Also allow CORS on regexes loaded from DJANGO_CORS_ALLOWED_ORIGIN_REG…
Browse files Browse the repository at this point in the history
…EXES environment variable
  • Loading branch information
Kurocon committed Feb 17, 2025
1 parent 5347b42 commit 93ebaf4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions amelie/settings/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def custom_show_toolbar(request):
# and URLs configured in DJANGO_EXTRA_CORS_ALLOWED_ORIGINS.
DJANGO_EXTRA_CORS_ALLOWED_ORIGINS = env.list("DJANGO_EXTRA_CORS_ALLOWED_ORIGINS", default=[])
CORS_ALLOWED_ORIGINS = [f"https://{host}" for host in DJANGO_ALLOWED_HOSTS_ENV] + DJANGO_EXTRA_CORS_ALLOWED_ORIGINS
CORS_ALLOWED_ORIGIN_REGEXES = env.list("DJANGO_CORS_ALLOWED_ORIGIN_REGEXES", default=[])

# Example: DJANGO_ADMINS="Jan Janssen <[email protected]>, Bob de Bouwer <[email protected]>"
ADMINS = getaddresses([env("DJANGO_ADMINS", default="WWW-committee <[email protected]>")])
Expand Down

0 comments on commit 93ebaf4

Please sign in to comment.