mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
Send multipart=true before open
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user