From 2ea11161fa3f4db243fca97550ed3f4cdcb27a89 Mon Sep 17 00:00:00 2001 From: Guillermo Rauch Date: Tue, 16 Mar 2010 21:17:14 -0700 Subject: [PATCH] Send multipart=true before open --- lib/transports/xhr-multipart.js | 1 - lib/transports/xhr.js | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/transports/xhr-multipart.js b/lib/transports/xhr-multipart.js index d75ca133..69dbf92b 100644 --- a/lib/transports/xhr-multipart.js +++ b/lib/transports/xhr-multipart.js @@ -5,7 +5,6 @@ io.Transport['xhr-multipart'] = io.Transport.XHR.extend({ connect: function(){ var self = this; this._xhr = this._request('', 'GET'); - this._xhr.multipart = true; this._xhr.onreadystatechange = function(){ if (self._xhr.readyState == 3) self._onData(self._xhr.responseText); else if (self._xhr.status == 200 && self._xhr.readyState == 4) self.connect(); diff --git a/lib/transports/xhr.js b/lib/transports/xhr.js index f114782d..a5b1d032 100644 --- a/lib/transports/xhr.js +++ b/lib/transports/xhr.js @@ -23,8 +23,9 @@ this._onDisconnect(); }, - _request: function(url, method){ + _request: function(url, method, multipart){ var req = request(); + if (multipart) req.multipart = true; req.open(method || 'GET', this._prepareUrl() + (url ? '/' + url : '')); if (method == 'POST'){ req.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=utf-8');