This commit is contained in:
Les De Ridder 2016-06-07 08:26:07 +02:00
parent 8f741fd9fa
commit 69a2d27a23
2 changed files with 9 additions and 3 deletions

View File

@ -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() {

View File

@ -26,5 +26,5 @@ function uploadBuffer(pomfclone, buffer, filename) {
request.onload = function(e) {
postMessage(request.response);
};
request.send(formData);
request.send2(formData);
};