summaryrefslogtreecommitdiff
path: root/addons/web/common/http.py
diff options
context:
space:
mode:
authorAntony Lesuisse <al@openerp.com>2012-01-23 01:48:12 +0100
committerAntony Lesuisse <al@openerp.com>2012-01-23 01:48:12 +0100
commit2f805ff45eb7139e34ae2d6bd553eeafec404729 (patch)
treede5ec4937446063719a9f85d1e09f0abfd8b2ec0 /addons/web/common/http.py
parent7d22e1eb8cf4058b923300e8e85c0375696460a2 (diff)
parentd0eb54d4c4f4502e6c920d16f0d48b0467120b22 (diff)
[MERGE] fix jsonp courtesy of florent.x
bzr revid: al@openerp.com-20120123004812-ec0548qfmkr0rbk8
Diffstat (limited to 'addons/web/common/http.py')
-rw-r--r--addons/web/common/http.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/web/common/http.py b/addons/web/common/http.py
index ac9b95dcb26..6d4bf1536a2 100644
--- a/addons/web/common/http.py
+++ b/addons/web/common/http.py
@@ -145,21 +145,22 @@ class JsonRequest(WebRequest):
jsonp = args.get('jsonp')
requestf = None
request = None
+ request_id = args.get('id')
if jsonp and self.httprequest.method == 'POST':
# jsonp 2 steps step1 POST: save call
self.init(args)
- req.session.jsonp_requests[args.get('id')] = self.httprequest.form['r']
+ self.session.jsonp_requests[request_id] = self.httprequest.form['r']
headers=[('Content-Type', 'text/plain; charset=utf-8')]
r = werkzeug.wrappers.Response(request_id, headers=headers)
return r
elif jsonp and args.get('r'):
# jsonp method GET
request = args.get('r')
- elif jsonp and args.get('id'):
+ elif jsonp and request_id:
# jsonp 2 steps step2 GET: run and return result
self.init(args)
- request = self.session.jsonp_requests.pop(args.get(id), "")
+ request = self.session.jsonp_requests.pop(request_id, "")
else:
# regular jsonrpc2
requestf = self.httprequest.stream