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

Add and use AllowAllCORSMixin #1099

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add and use AllowAllCORSMixin #1099

wants to merge 2 commits into from

Conversation

x753
Copy link
Contributor

@x753 x753 commented Feb 14, 2025

Sets the Access-Control-Allow-Origin header to * for package version, package retrieval, and legacy profile retrieval APIs. This allows other websites to call them.

The likely result of this is that we'll have websites that call /api/experimental/package/{namespace}/{name}/ hundreds of times while reading a modpack. The Mod Managers don't currently have that problem because they pull that info directly from the package index which is retrieved once.

Add AllowAllCORSMixin and apply it to legacy profile retrieval API and
package version APIs
@x753
Copy link
Contributor Author

x753 commented Feb 14, 2025

No tests at the moment because the local default applies the Access-Control-Allow-Origin header to every response.

Remove the AllowAllCORSMixin from every API except LegacyProfileRetrieveApiView,
which is unlikely to cause any problems from being opened but also might not work
because it redirects to a page that likely isn't open
@x753 x753 requested a review from Roffenlund February 19, 2025 16:08
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.

1 participant