I'm trying to enable CORS in SailsJS v0.9.15... It doesn't help if i set "allRoutes: true" in cors.js, i'm still getting CORS related errors. Why is this not working? According to this, it should be enough... https://github.com/balderdashy/sails-docs/blob/master/todo/config.cors.md
Error in Firefox: "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at www.domain.com. This can be fixed by moving the resource to the same domain or enabling CORS."
Error in Chrome: "The 'Access-Control-Allow-Origin' header contains the invalid value 'null'. Origin 'www.domain.com' is therefore not allowed access."
Is this a bug?
Sails.js (REST api) is hosted on Openshift, could that be a problem?
Thanks for help...
Just to make this official, there is an open issue about CORS headers being filtered out by OpenShift. CORS should work fine in Sails for deployments that don't block those headers. Documentation for CORS in Sails is here and here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With