[FIX] http: correct jsonp 2pass
bzr revid: chs@openerp.com-20140115162242-cyqb02wxmlhxqtu6
This commit is contained in:
parent
eae55df214
commit
29cd983258
|
@ -286,7 +286,7 @@ class JsonRequest(WebRequest):
|
||||||
if jsonp and self.httprequest.method == 'POST':
|
if jsonp and self.httprequest.method == 'POST':
|
||||||
# jsonp 2 steps step1 POST: save call
|
# jsonp 2 steps step1 POST: save call
|
||||||
def handler():
|
def handler():
|
||||||
self.session.jsonp_requests[request_id] = self.httprequest.form['r']
|
self.session['jsonp_request_%s' % (request_id,)] = self.httprequest.form['r']
|
||||||
self.session.modified = True
|
self.session.modified = True
|
||||||
headers=[('Content-Type', 'text/plain; charset=utf-8')]
|
headers=[('Content-Type', 'text/plain; charset=utf-8')]
|
||||||
r = werkzeug.wrappers.Response(request_id, headers=headers)
|
r = werkzeug.wrappers.Response(request_id, headers=headers)
|
||||||
|
@ -298,7 +298,7 @@ class JsonRequest(WebRequest):
|
||||||
request = args.get('r')
|
request = args.get('r')
|
||||||
elif jsonp and request_id:
|
elif jsonp and request_id:
|
||||||
# jsonp 2 steps step2 GET: run and return result
|
# jsonp 2 steps step2 GET: run and return result
|
||||||
request = self.session.jsonp_requests.pop(request_id, "")
|
request = self.session.pop('jsonp_request_%s' % (request_id,), '{}')
|
||||||
else:
|
else:
|
||||||
# regular jsonrpc2
|
# regular jsonrpc2
|
||||||
request = self.httprequest.stream.read()
|
request = self.httprequest.stream.read()
|
||||||
|
@ -637,7 +637,6 @@ class OpenERPSession(werkzeug.contrib.sessions.Session):
|
||||||
self.setdefault("login", None)
|
self.setdefault("login", None)
|
||||||
self.setdefault("password", None)
|
self.setdefault("password", None)
|
||||||
self.setdefault("context", {'tz': "UTC", "uid": None})
|
self.setdefault("context", {'tz': "UTC", "uid": None})
|
||||||
self.setdefault("jsonp_requests", {})
|
|
||||||
|
|
||||||
def get_context(self):
|
def get_context(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue