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

This Forum is about the Opentherm gateway (OTGW) from Schelte

Moderator: hvxl

Post Reply
RedNax
Starting Member
Starting Member
Posts: 39
Joined: Wed Sep 25, 2013 12:18 pm

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

Post 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!
RedNax
Starting Member
Starting Member
Posts: 39
Joined: Wed Sep 25, 2013 12:18 pm

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

Post by RedNax »

Nevermind, made my own version with the appropriate header. Everything now works as it should :D
timoline
Starting Member
Starting Member
Posts: 34
Joined: Sat Nov 07, 2015 2:30 pm

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

Post by timoline »

still it would be nice it's included by default
Post Reply

Return to “Opentherm Gateway Forum”