I was modifying the wrong set of libs - I got it to work. However I feel
like the webob's response header options should be set from within Ryu
instead of setting it in python libs.
FYI:
Locate the file :
/usr/local/lib/python2.7/dist-packages/WebOb-1.3.1-py2.7.egg/webob/response.py
add the following line as soon as the headerlist is set. This is hackish at
best - more appropriate way might be to subclass Response within Ryu, grab
the headerlist and append it there.
self._headerlist.append(('Access-Control-Allow-Origin', '*'))
best,
DJ
On Wed, Apr 2, 2014 at 10:07 AM, Dhananjay Sampath <
[email protected]> wrote:
> Hi,
>
> I am trying to build a front end that queries the Ryu REST service from
> within a JS. However, when I try to execute a GET from within the script
> context then I get the following error:
>
> XMLHttpRequest cannot load http://tap-test.t-labs.us:8080/switches. No
> 'Access-Control-Allow-Origin' header is present on the requested resource.
> Origin 'http://localhost:8888 <http://localhost/>' is therefore not
> allowed access.
>
> I have tried the following :
> 1. Added it to the headers dict inside wsgi.py (python distro) (nothin
> happend)
> 2. Obtained res from req and tried to add it (errored out)
> 3. Added it to the webob response header list (nothing happend)
>
> any pointers will be much appreciated.
>
> best,
> DJ
>
>
> --
> --
> Luminous beings we are, not this crude matter
>
--
--
Luminous beings we are, not this crude matter
------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel