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

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

Moderator: hvxl

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

Postby RedNax » Wed May 18, 2016 6:30 am

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: September 2013

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

Postby RedNax » Sat May 21, 2016 12:27 pm

Nevermind, made my own version with the appropriate header. Everything now works as it should :D
RedNax
Starting Member
Starting Member
 
Posts: 39
Joined: September 2013

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

Postby timoline » Sat May 21, 2016 8:08 pm

still it would be nice it's included by default
timoline
Starting Member
Starting Member
 
Posts: 33
Joined: November 2015


Return to Opentherm Gateway Forum

Who is online

Users browsing this forum: No registered users and 1 guest

cron