[IMP] Use CORS in pos (only two routes)

bzr revid: fme@openerp.com-20140130122752-kfgo7u0q0crn3tbr
This commit is contained in:
Fabien Meghazi 2014-01-30 13:27:52 +01:00
parent b63b03abd0
commit 9ce7c7d561
1 changed files with 3 additions and 8 deletions

View File

@ -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