|
|
|
@ -28,7 +28,7 @@ |
|
|
|
|
exports.FormData = FormData; |
|
|
|
|
|
|
|
|
|
var ___send$rw = XMLHttpRequest.prototype.send; |
|
|
|
|
XMLHttpRequest.prototype.send = function(data) { |
|
|
|
|
XMLHttpRequest.prototype.send2 = function(data) { |
|
|
|
|
if (data instanceof FormData) { |
|
|
|
|
if (!data.__endedMultipart) data.__append('--' + data.boundary + '--\r\n'); |
|
|
|
|
data.__endedMultipart = true; |
|
|
|
@ -36,7 +36,13 @@ |
|
|
|
|
data = new Uint8Array(data.data); |
|
|
|
|
} |
|
|
|
|
// Invoke original XHR.send
|
|
|
|
|
return ___send$rw.call(this, data); |
|
|
|
|
|
|
|
|
|
//https://bugzilla.mozilla.org/show_bug.cgi?id=1085060
|
|
|
|
|
var copy = new ArrayBuffer(data.byteLength); |
|
|
|
|
new Uint8Array(copy).set(new Uint8Array(data)); |
|
|
|
|
|
|
|
|
|
console.log("sending"); |
|
|
|
|
return this.send(copy); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
function FormData() { |
|
|
|
|