From 4910de7f3c6a6f8fd8c53906b367168223de733b Mon Sep 17 00:00:00 2001 From: Florent Xicluna Date: Mon, 16 Jan 2012 15:55:24 +0100 Subject: [PATCH 1/2] [FIX] NameError in jsonp POST. bzr revid: florent.xicluna@gmail.com-20120116145524-razqfr39bf4b4t9v --- addons/web/common/http.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/web/common/http.py b/addons/web/common/http.py index 681a38384a2..3e6ee257ea3 100644 --- a/addons/web/common/http.py +++ b/addons/web/common/http.py @@ -146,7 +146,8 @@ class JsonRequest(WebRequest): 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'] + request_id = args.get('id') + 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 From d0eb54d4c4f4502e6c920d16f0d48b0467120b22 Mon Sep 17 00:00:00 2001 From: Florent Xicluna Date: Wed, 18 Jan 2012 20:04:09 +0100 Subject: [PATCH 2/2] =?UTF-8?q?[FIX]=C2=A0a=20typo=20between=20'id'=20and?= =?UTF-8?q?=20builtin=20.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bzr revid: florent.xicluna@gmail.com-20120118190409-ddg3bbvb7r9jzyjc --- addons/web/common/http.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/web/common/http.py b/addons/web/common/http.py index 3e6ee257ea3..50a6b43e909 100644 --- a/addons/web/common/http.py +++ b/addons/web/common/http.py @@ -142,11 +142,11 @@ 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) - request_id = args.get('id') 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) @@ -154,10 +154,10 @@ class JsonRequest(WebRequest): 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