Is there a slick way to enable CORS with the Cloud Endpoints?
(Adding "Access-Control-Allow-Origin: *" or something like this to the response)
Thanks, Brandon
Is there a slick way to enable CORS with the Cloud Endpoints?
(Adding "Access-Control-Allow-Origin: *" or something like this to the response)
Thanks, Brandon
As CORS works on production for Cloud Endpoints. What I did to test on devserver (local) was to disable the browser security. For Dartium (I think Chrome also) use --disable-web-security parameter on startup.
Try adding this to the yaml file of your endpoint:
x-google-endpoints:
- name: "{your-endpoint-host-name}"
allowCors: "true"
This depends on if you have control over the headers on the endpoints - either via the application or the web server serving the original page which contains scripts that want to make cross domain requests.
JSON-P still seems far more popular - either due to lack of support on the server side of platforms, or a distrust that it will work with clients (e.g. legacy web browsers) - whereas JSON-P will often work.