Page 1 of 1

Please add Access-Control-Allow-Origin header on JSON

Posted: Wed May 18, 2016 7:30 am
by RedNax
Hi,

Could you please add the Access-Control-Allow-Origin "*" header to the json output? I'm trying to display some of the otgw output on my magicmirror by getting the JSON using a js script, but modern browsers have CORS implemented and won't allow it when the header isn't present. You'll receive the following error:

MMM-OpenTherm.js:185 XMLHttpRequest cannot load http://xxx.xxx.xxx.xxx:/json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://xxx.xxx.xxx.yyy:8080' is therefore not allowed access.

Thanks!

Re: Please add Access-Control-Allow-Origin header on JSON

Posted: Sat May 21, 2016 1:27 pm
by RedNax
Nevermind, made my own version with the appropriate header. Everything now works as it should :D

Re: Please add Access-Control-Allow-Origin header on JSON

Posted: Sat May 21, 2016 9:08 pm
by timoline
still it would be nice it's included by default