tborja at June 2nd, 2014 22:44 — #1
OPTIONS https://df.systemacorp.com/rest/api_docs net::ERR_INSECURE_RESPONSE shred.bundle.js:3306
Uncaught Can't read from server. It may not have the appropriate access-control-origin settings. swagger.js:213
(anonymous function) shred.bundle.js:1236
(anonymous function) shred.bundle.js:1867
Do I have to set something else on the Bitnami Stack installation to make CORS work?
carlos_corrales at June 3rd, 2014 05:13 — #2
It seems that you have to configure some CORS related headers in the Apache configuration to make it work.
Could you paste here the output of this command?
curl -I http://df.systemacorp.com/rest/api_docs
I tried it but I get a 400 error. Maybe the URL is not correct?
We you have to do to modify the headers is opening the apache configuration file (/opt/bitnami/apache2/conf/httpd.conf) and look for this code
<IfVersion >= 2.4.7 >
Header always setifempty X-Frame-Options SAMEORIGIN
<IfVersion < 2.4.7 >
Header always merge X-Frame-Options SAMEORIGIN
And add there (inside the IfModule) the Header that CORS needs.
Header set Access-Control-Allow-Origin "*"
You have more information here
Hope it helps!
tborja at June 3rd, 2014 07:23 — #3
Adding Header set Access-Control-Allow-Origin "*" to "IfModule headers_module" did the trick. I noticed that the connection only works if I connect via http and not https to my dreamfactory server. I guess I have to manually setup SSL on my server.
Thanks for your help.
benbusse at June 4th, 2014 14:12 — #4
@tborja Glad you figured it out. Make sure to set up SSL. More info here. Contact email@example.com if you need any help.