Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow course import from Course Authoring MFE #1063

Merged
merged 2 commits into from
May 8, 2024

Conversation

ormsbee
Copy link
Contributor

@ormsbee ormsbee commented May 8, 2024

This commit removes the CORS_ALLOW_HEADERS setting from the LMS/Studio config template. This is set separately by LMS and Studio config files in edx-platform and should not be overridden by Tutor, since the header types to allow is application logic and will not vary between sites. This 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). This had been set correctly in edx-platform, but was being overridden by Tutor.

This commit removes the CORS_ALLOW_HEADERS setting from the LMS/Studio
config template. This is set separately by LMS and Studio config files
in edx-platform and should not be overridden by Tutor, since the header
types to allow is application logic and will not vary between sites.
This 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).
This had been set correctly in edx-platform, but was being overridden by
Tutor.
@kdmccormick kdmccormick self-requested a review May 8, 2024 16:44
Copy link
Contributor

@arbrandes arbrandes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, setting this here only makes it so we have to keep tabs on upstream and update it when it does. I don't see the point of doing so, so I vote for removing it.

@kdmccormick
Copy link
Collaborator

For historical context, it looks like we added this override here: #743 (review)

Copy link
Collaborator

@kdmccormick kdmccormick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might break in tutor local mode. Conversation ongoing in Slack, I'll paste a summary here after.

@kdmccormick
Copy link
Collaborator

kdmccormick commented May 8, 2024

I suspect that:

So, @ormsbee will fix upstream production.py to set CORS_ALLOW_HEADERS unconditionally, which will allow us to remove the extra override here

@ormsbee
Copy link
Contributor Author

ormsbee commented May 8, 2024

Thanks @kdmccormick!

Blocked on openedx/edx-platform#34743

Copy link
Collaborator

@kdmccormick kdmccormick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using tutor local run lms/cms ./manage.py lms/cms print_setting CORS_ALLOW_HEADERS, I confirmed my suspicion that we needed to override CORS_ALLOW_HEADERS here, and I also confirmed that Dave's edx-platform PR removes the need for us to override it. LGTM pending the upstream PR 👍🏻

@kdmccormick kdmccormick merged commit c3d35af into overhangio:nightly May 8, 2024
2 checks passed
@ormsbee ormsbee deleted the fix_cors_headers branch May 8, 2024 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants