03-30-2016 14:06
03-30-2016 14:06
Hi. I'm making calls to Fitbit and have only tested in Chrome this far. I recieve:
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource...
I was reading in this post that Fitbit is supporting CORS but it doesn't seem like it, am I wrong?
Thanks
Daniel
Answered! Go to the Best Answer.
03-30-2016 14:53
03-30-2016 14:53
The Fitbit Web API supports CORS. Here's it working in a quick test I just did.
03-30-2016 14:53
03-30-2016 14:53
The Fitbit Web API supports CORS. Here's it working in a quick test I just did.
03-30-2016 14:55
03-30-2016 14:55
Did your preflight request properly set a `referer` header?
03-31-2016 00:23
03-31-2016 00:23
Yes, it had the correct referrer. I managed to solve by adding some headers to my .htaccess! Thanks for your time though 🙂
06-02-2016 10:45
06-02-2016 10:45
Could you post what headers you added to .htaccess? Thanks!
06-04-2016 11:26
06-04-2016 11:26
Sure, what worked for me was adding this:
<IfModule mod_headers.c>
#Header add Access-Control-Allow-Origin "http://mydomain.com"
#Header set Access-Control-Allow-Origin "*"
#Header set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE"
#Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept"
</IfModule>
06-12-2016 00:44
06-12-2016 00:44
Just this work for me
<IfModule mod_headers.c>
Header add Access-Control-Allow-Origin "*"
</IfModule>
And checkout this guide for Cross Origin Access Header, very good explaination on how it works