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

CORS handling #2

Closed
pabo3000 opened this issue Apr 1, 2015 · 2 comments
Closed

CORS handling #2

pabo3000 opened this issue Apr 1, 2015 · 2 comments

Comments

@pabo3000
Copy link

pabo3000 commented Apr 1, 2015

If you have a frontend app for example running on port 9000 and it requests the plone backend on localhost:8080 you will get:

XMLHttpRequest cannot load http://localhost:8080/plone/@@json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:9000' is therefore not allowed access.

This is CORS issue. The frontend address has to be registered as an allowed ressouce in the plone backend (zope server).

IMHO a CORS TTW configuration is desirable. Perhaps it is a good idea to have an isolated package plone.cors which offers a configlet and a server response patch.

In the Pyramid world The Cornice REST framework has to deal with this issue and can simply be configured: http://cornice.readthedocs.org/en/latest/api.html
In The Django world a so called middle ware can be registered and configured in settings.py: https://github.com/ottoyiu/django-cors-headers

Background:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
http://www.html5rocks.com/en/tutorials/cors/
http://enable-cors.org/

@casdr
Copy link
Member

casdr commented Feb 16, 2016

Any update on this? We have the same issue and haven't been able to find where to fix this.

@tisto
Copy link
Member

tisto commented Feb 16, 2016

See plone/plone.rest#11 for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants