fix: update mock config to include scheme for csrf domains (#37120)

Since the scheme must be included for the CSRF_TRUSTED_ORIGINS setting since
Django 4.0, this changes the values in the mock.yml configuration files to use
the scheme for the values under CSRF_TRUSTED_ORIGINS. We match the values
defined under CSRF_TRUSTED_ORIGINS_WITH_SCHEME key.

lms/envs/production.py pulls from CSRF_TRUSTED_ORIGINS_WITH_SCHEME in the YAML
config to set the CSRF_TRUSTED_ORIGINS setting , but cms/envs/production.py
pulls from CSRF_TRUSTED_ORIGINS in the YAML. So, this change fixes the CMS when
run with mock.yml.
This commit is contained in:
Taylor Payne
2025-08-08 09:31:04 -06:00
committed by GitHub
parent 4a9fc77ecb
commit 325a0c116a
2 changed files with 2 additions and 2 deletions

View File

@@ -246,7 +246,7 @@ CROSS_DOMAIN_CSRF_COOKIE_DOMAIN: .localhost
CROSS_DOMAIN_CSRF_COOKIE_NAME: csrftoken
CSRF_COOKIE_SECURE: true
CSRF_TRUSTED_ORIGINS:
- .localhost
- https://*.localhost
CSRF_TRUSTED_ORIGINS_WITH_SCHEME:
- https://*.localhost
DATABASES:

View File

@@ -329,7 +329,7 @@ CROSS_DOMAIN_CSRF_COOKIE_DOMAIN: ''
CROSS_DOMAIN_CSRF_COOKIE_NAME: ''
CSRF_COOKIE_SECURE: true
CSRF_TRUSTED_ORIGINS:
- .sandbox.localhost
- https://*.sandbox.localhost
CSRF_TRUSTED_ORIGINS_WITH_SCHEME:
- https://*.sandbox.localhost
DASHBOARD_COURSE_LIMIT: 250