Skip to content

Commit d39b715

Browse files
authored
Revert "fix: remove CSRF_TRUSTED_ORIGINS_WITH_SCHEME variable (#37195)"
This reverts commit cb80118.
1 parent cb80118 commit d39b715

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

cms/envs/mock.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ CROSS_DOMAIN_CSRF_COOKIE_NAME: csrftoken
247247
CSRF_COOKIE_SECURE: true
248248
CSRF_TRUSTED_ORIGINS:
249249
- https://*.localhost
250+
CSRF_TRUSTED_ORIGINS_WITH_SCHEME:
251+
- https://*.localhost
250252
DATABASES:
251253
blockstore:
252254
CONN_MAX_AGE: 600

cms/envs/production.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ def get_env_setting(setting):
155155
# Once we have migrated to service assets off S3, then we can convert this back to
156156
# managed by the yaml file contents
157157
STATICFILES_STORAGE = os.environ.get('STATICFILES_STORAGE', STATICFILES_STORAGE)
158+
CSRF_TRUSTED_ORIGINS = _YAML_TOKENS.get('CSRF_TRUSTED_ORIGINS_WITH_SCHEME', [])
158159

159160
MKTG_URL_LINK_MAP.update(_YAML_TOKENS.get('MKTG_URL_LINK_MAP', {}))
160161

lms/envs/mock.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,8 @@ CROSS_DOMAIN_CSRF_COOKIE_NAME: ''
330330
CSRF_COOKIE_SECURE: true
331331
CSRF_TRUSTED_ORIGINS:
332332
- https://*.sandbox.localhost
333+
CSRF_TRUSTED_ORIGINS_WITH_SCHEME:
334+
- https://*.sandbox.localhost
333335
DASHBOARD_COURSE_LIMIT: 250
334336
DATABASES:
335337
blockstore:

lms/envs/production.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ def get_env_setting(setting):
197197
service_variant=SERVICE_VARIANT,
198198
)
199199

200+
CSRF_TRUSTED_ORIGINS = _YAML_TOKENS.get('CSRF_TRUSTED_ORIGINS_WITH_SCHEME', [])
201+
200202
if FEATURES['ENABLE_CORS_HEADERS'] or FEATURES.get('ENABLE_CROSS_DOMAIN_CSRF_COOKIE'):
201203
CORS_ALLOW_CREDENTIALS = True
202204
CORS_ORIGIN_WHITELIST = _YAML_TOKENS.get('CORS_ORIGIN_WHITELIST', ())

0 commit comments

Comments
 (0)