diff options
| author | Fabien Meghazi <fme@openerp.com> | 2014-01-30 13:27:52 +0100 |
|---|---|---|
| committer | Fabien Meghazi <fme@openerp.com> | 2014-01-30 13:27:52 +0100 |
| commit | 9ce7c7d561ba3f2aff9f2eafda1c8dffd05e8b1f (patch) | |
| tree | 41fe21750d3b75b9876fce85002685e6dd2c9ae2 /addons/hw_proxy | |
| parent | b63b03abd0c8109faa32803d2ae32663e1b64133 (diff) | |
[IMP] Use CORS in pos (only two routes)
bzr revid: fme@openerp.com-20140130122752-kfgo7u0q0crn3tbr
Diffstat (limited to 'addons/hw_proxy')
| -rw-r--r-- | addons/hw_proxy/controllers/main.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/addons/hw_proxy/controllers/main.py b/addons/hw_proxy/controllers/main.py index adb59a072b3..e6c19e322d6 100644 --- a/addons/hw_proxy/controllers/main.py +++ b/addons/hw_proxy/controllers/main.py @@ -33,16 +33,11 @@ class Proxy(http.Controller): statuses[driver] = drivers[driver].get_status() return statuses - @http.route('/hw_proxy/hello', type='http', auth='none') + @http.route('/hw_proxy/hello', type='http', auth='none', cors='*') def hello(self): - return request.make_response('ping', { - 'Cache-Control': 'no-cache', - 'Content-Type': 'text/html; charset=utf-8', - 'Access-Control-Allow-Origin': '*', - 'Access-Control-Allow-Methods': 'GET', - }) + return "ping" - @http.route('/hw_proxy/handshake', type='json', auth='none') + @http.route('/hw_proxy/handshake', type='json', auth='none', cors='*') def handshake(self): return True |
