[web2py] CORS and raise HTTP()

2015-10-02 Thread Anthony
Should be: raise HTTP(404, **response.headers) Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are

[web2py] CORS and raise HTTP()

2015-10-02 Thread Kiran Subbaraman
Hello all, My javascript is making a CORS call to web2py; wherein I have set the following in my controller: response.headers['Content-Type'] = 'application/json; charset=utf-8' response.headers['Access-Control-Allow-Origin'] = '*' response.headers['Access-Control-Max-Age'] = 86400

Re: [web2py] CORS and raise HTTP()

2015-10-02 Thread Kiran Subbaraman
Anthony, Thank you. That works. I thought this behaviour would have been there by default... or any idea, why not? Kiran Subbaraman http://subbaraman.wordpress.com/about/ On Fri, 02-10-2015 7:07 PM, Anthony wrote: Should be: raise HTTP(404,

Re: [web2py] CORS and raise HTTP()

2015-10-02 Thread Anthony
HTTP is a generic exception that is not tied to the web2py environment -- therefore it doesn't know about response and response.headers. It is typically used to abort the current request processing and return a response immediately, so you would often want to ignore any existing

Re: [web2py] CORS and raise HTTP()

2015-10-02 Thread Kiran Subbaraman
Ok, I understand this better now. Thanks. Kiran Subbaraman http://subbaraman.wordpress.com/about/ On Fri, 02-10-2015 11:33 PM, Anthony wrote: HTTP is a generic exception that is not tied to the web2py environment -- therefore it doesn't know about