dyvardana / webiopi

Automatically exported from code.google.com/p/webiopi
0 stars 0 forks source link

CORS support #50

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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 
http://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.

Original issue reported on code.google.com by h.schoen...@gmail.com on 14 May 2013 at 8:17

GoogleCodeExporter commented 9 years ago
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

Original comment by h.schoen...@gmail.com on 16 May 2013 at 1:44

GoogleCodeExporter commented 9 years ago

Original comment by tro...@trouch.com on 16 May 2013 at 9:42

GoogleCodeExporter commented 9 years ago
How about if using username password ?

Original comment by adisi...@gmail.com on 23 Dec 2014 at 3:34