From 9ce7c7d561ba3f2aff9f2eafda1c8dffd05e8b1f Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 30 Jan 2014 13:27:52 +0100 Subject: [PATCH] [IMP] Use CORS in pos (only two routes) bzr revid: fme@openerp.com-20140130122752-kfgo7u0q0crn3tbr --- addons/hw_proxy/controllers/main.py | 11 +++-------- 1 file 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