Skip to content

Commit

Permalink
fix: allow course import from Course Authoring MFE (#1063)
Browse files Browse the repository at this point in the history
Remove CORS_ALLOW_HEADERS setting from the LMS/Studio config template. This
setting, which holds site-agnostic application logic, is now consistently set
to a reasonable value upstream by LMS and CMS config. Using the upstream values
fixes a bug where course import in Studio using the new Course Authoring MFE
was broken in Tutor deployments because it required additional headers to be
allowed (content-range and content-disposition)

Co-authored-by: Kyle McCormick <[email protected]>
  • Loading branch information
ormsbee and kdmccormick authored May 8, 2024
1 parent 9738eb0 commit c3d35af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/20240508_111720_dave_fix_cors_headers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [Bugfix] Remove CORS_ALLOW_HEADERS setting from the LMS/Studio config template. This setting, which holds site-agnostic application logic, is now consistently set to a reasonable value upstream by LMS and CMS config. Using the upstream values fixes a bug where course import in Studio using the new Course Authoring MFE was broken in Tutor deployments because it required additional headers to be allowed (content-range and content-disposition) (by @ormsbee)
3 changes: 2 additions & 1 deletion tutor/templates/apps/openedx/settings/partials/common_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@
CORS_ALLOW_CREDENTIALS = True
CORS_ORIGIN_ALLOW_ALL = False
CORS_ALLOW_INSECURE = {% if ENABLE_HTTPS %}False{% else %}True{% endif %}
CORS_ALLOW_HEADERS = corsheaders_default_headers + ('use-jwt-cookie',)
# Note: CORS_ALLOW_HEADERS is intentionally not defined here, because it should
# be consistent across deployments, and is therefore set in edx-platform.

# Add your MFE and third-party app domains here
CORS_ORIGIN_WHITELIST = []
Expand Down

0 comments on commit c3d35af

Please sign in to comment.