diff --git a/lms/envs/aws.py b/lms/envs/aws.py index e9a0e463d8..85dc51f145 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -23,6 +23,7 @@ import os import logging import dateutil +from corsheaders.defaults import default_headers as corsheaders_default_headers from path import Path as path from xmodule.modulestore.modulestore_settings import convert_module_store_setting_if_needed @@ -428,6 +429,9 @@ if FEATURES.get('ENABLE_CORS_HEADERS') or FEATURES.get('ENABLE_CROSS_DOMAIN_CSRF CORS_ORIGIN_WHITELIST = ENV_TOKENS.get('CORS_ORIGIN_WHITELIST', ()) CORS_ORIGIN_ALLOW_ALL = ENV_TOKENS.get('CORS_ORIGIN_ALLOW_ALL', False) CORS_ALLOW_INSECURE = ENV_TOKENS.get('CORS_ALLOW_INSECURE', False) + CORS_ALLOW_HEADERS = corsheaders_default_headers + ( + 'use-jwt-cookie', + ) # If setting a cross-domain cookie, it's really important to choose # a name for the cookie that is DIFFERENT than the cookies used diff --git a/lms/envs/common.py b/lms/envs/common.py index 6f6697c754..554cfc9600 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -32,6 +32,7 @@ import imp import sys import os +from corsheaders.defaults import default_headers as corsheaders_default_headers from path import Path as path from django.utils.translation import ugettext_lazy as _ @@ -2509,6 +2510,9 @@ if FEATURES.get('ENABLE_CORS_HEADERS'): CORS_ALLOW_CREDENTIALS = True CORS_ORIGIN_WHITELIST = () CORS_ORIGIN_ALLOW_ALL = False + CORS_ALLOW_HEADERS = corsheaders_default_headers + ( + 'use-jwt-cookie', + ) # Default cache expiration for the cross-domain proxy HTML page. # This is a static page that can be iframed into an external page diff --git a/lms/envs/production.py b/lms/envs/production.py index 6f229d23bd..863c586c22 100644 --- a/lms/envs/production.py +++ b/lms/envs/production.py @@ -23,6 +23,7 @@ import json import os import dateutil +from corsheaders.defaults import default_headers as corsheaders_default_headers from path import Path as path from xmodule.modulestore.modulestore_settings import convert_module_store_setting_if_needed @@ -424,6 +425,9 @@ if FEATURES.get('ENABLE_CORS_HEADERS') or FEATURES.get('ENABLE_CROSS_DOMAIN_CSRF CORS_ORIGIN_WHITELIST = ENV_TOKENS.get('CORS_ORIGIN_WHITELIST', ()) CORS_ORIGIN_ALLOW_ALL = ENV_TOKENS.get('CORS_ORIGIN_ALLOW_ALL', False) CORS_ALLOW_INSECURE = ENV_TOKENS.get('CORS_ALLOW_INSECURE', False) + CORS_ALLOW_HEADERS = corsheaders_default_headers + ( + 'use-jwt-cookie', + ) # If setting a cross-domain cookie, it's really important to choose # a name for the cookie that is DIFFERENT than the cookies used