-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Proxito: update CORS settings #10751
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
Conversation
- Only add CORS headers on community site - Explicit host on `Access-Control-Allow-Origin` - Only query the database if the host ends with `RTD_EXTERNAL_VERSION_DOMAIN` - Add more tests Continuation of #10737
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to add the origin header to vary if the origin is set per-origin instead of *, similar to
But again, we should be fine using *
, the most important part here is that we aren't enabling this in .com yet.
I added the |
Pushed some changes:
Using Next step I would like to add these headers per view instead of having it in the middleware, having it per-view it's more scoped, and we don't have to query the DB again. |
Looks great! Thanks for jumping in into this PR 🚀 |
* Proxito: update CORS settings - Only add CORS headers on community site - Explicit host on `Access-Control-Allow-Origin` - Only query the database if the host ends with `RTD_EXTERNAL_VERSION_DOMAIN` - Add more tests Continuation of #10737 * Add `Vary: Origin` header * Use Django internals to patch `Vary` header. * Use the `Origin` header from request to check for the allowed domain * Update tests to use `origin` header * Allow cross-origin requests for public versions' docs --------- Co-authored-by: Santos Gallegos <[email protected]>
* Proxito: update CORS settings - Only add CORS headers on community site - Explicit host on `Access-Control-Allow-Origin` - Only query the database if the host ends with `RTD_EXTERNAL_VERSION_DOMAIN` - Add more tests Continuation of #10737 * Add `Vary: Origin` header * Use Django internals to patch `Vary` header. * Use the `Origin` header from request to check for the allowed domain * Update tests to use `origin` header * Allow cross-origin requests for public versions' docs --------- Co-authored-by: Santos Gallegos <[email protected]>
Access-Control-Allow-Origin
RTD_EXTERNAL_VERSION_DOMAIN
Continuation of #10737