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

setting CORS headers #820

Open
flipmcf opened this issue Oct 15, 2022 · 2 comments
Open

setting CORS headers #820

flipmcf opened this issue Oct 15, 2022 · 2 comments

Comments

@flipmcf
Copy link
Contributor

flipmcf commented Oct 15, 2022

The docker images are running this to get CORS errors to go away:

https://github.com/plone/plone-backend/blob/6.0.x/skeleton/scripts/cors.py

I'm thinking this needs to be written to zcml - as they do it, but maybe from settings from zope.conf and maybe some default variables in buildout.cfg or mx.ini

Thoughts?

@davisagli
Copy link
Member

@flipmcf Assuming your package's zcml is already loaded in the buildout configuration (i.e. in the zcml = setting for plone.recipe.zope2instance, or using plone.autoinclude) you should be able to simply put this zcml inside your Python package in overrides.zcml (or another file included from there)

@flipmcf
Copy link
Contributor Author

flipmcf commented Oct 15, 2022

This is exactly how I'm handling it now. I'm thinking into the future where you can configure your backend site-settings and store these in the registry.

the use-case is that I want a UI interface (so I don't have to code).
Also, consider the use case where zope/plone installs that run multiple sites through VHM and each needs it's own CORS config. Not my use case specially, but definitely others have this.

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

No branches or pull requests

2 participants