Issue #050 [Duplicate/closed] - CORS support

Posted by h.schoenleutner

Hi Eric, what do you think about CORS support (for making cross domain ajax calls possible without additional proxys)?

Here you will find some infos about cors https://www.html5rocks.com/en/tutorials/cors/ and here I found a phyton server with cors in github: https://gist.github.com/gkatsev/3796275

WebIOPi version used? => 6

Python version used? => 3

Distro used? (WebIOPi has only been tested on Raspbian Wheezy) => Wheezy

Raspberry Pi board revision? (1 or 2) => 1

For Javascript side bugs, Browser? => Crome,FF20

Please provide any additional information below.


Comment 1

Posted by h.schoenleutner

I had some time and figured out a solution. May you want to change it for the next release

You can added two lines below line 129 ( self.send_header("Cache-Control", "no-cache")

in /protocols/http.py

self.send_header("Access-Control-Allow-Origin", "*") self.send_header("Access-Control-Allow-Methods", "POST, GET")

Have a nice evening

Herbert


Comment 2

Posted by trouch


Comment 3

Posted by adisis23

How about if using username password ?