diff options
| author | Christophe Simonis <chs@openerp.com> | 2012-11-14 12:33:35 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@openerp.com> | 2012-11-14 12:33:35 +0100 |
| commit | e1f5dfc388b1a5d8269b74cbde6b6f599a44f9ef (patch) | |
| tree | 6a42bb526d95396140f00edc093fdc11a2226172 /addons/web/static/src | |
| parent | 524c3d500dd865af04a98f52cdf4b9eec90bc465 (diff) | |
[FIX] jsonp wasn't working on some browse due to security restriction that do not store the third parties cookies.
bzr revid: chs@openerp.com-20121114113335-nag3ljcwwx0yfdnu
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/corelib.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/addons/web/static/src/js/corelib.js b/addons/web/static/src/js/corelib.js index 4012be526e6..5c4ef8b5cbb 100644 --- a/addons/web/static/src/js/corelib.js +++ b/addons/web/static/src/js/corelib.js @@ -1309,8 +1309,17 @@ instance.web.JsonRPC = instance.web.Class.extend(instance.web.PropertiesMixin, { // extracted from payload to set on the url var data = { session_id: this.session_id, - id: payload.id + id: payload.id, + sid: this.httpsessionid, }; + + var set_sid = function (response, textStatus, jqXHR) { + // If response give us the http session id, we store it for next requests... + if (response.httpsessionid) { + self.httpsessionid = response.httpsessionid; + } + }; + url.url = this.get_url(url.url); var ajax = _.extend({ type: "GET", @@ -1326,7 +1335,7 @@ instance.web.JsonRPC = instance.web.Class.extend(instance.web.PropertiesMixin, { if(payload_url.length < 2000) { // Direct jsonp request ajax.data.r = payload_str; - return $.ajax(ajax); + return $.ajax(ajax).done(set_sid); } else { // Indirect jsonp request var ifid = _.uniqueId('oe_rpc_iframe'); @@ -1364,7 +1373,7 @@ instance.web.JsonRPC = instance.web.Class.extend(instance.web.PropertiesMixin, { }); // append the iframe to the DOM (will trigger the first load) $form.after($iframe); - return deferred; + return deferred.done(set_sid); } }, get_url: function (file) { |
