Commit 5c780c15 authored by Aurel's avatar Aurel

wait for buffer to be filled before sending request

parent a7993447
This diff is collapsed.
This diff is collapsed.
......@@ -2149,8 +2149,10 @@ return new Parser;
if (param.data instanceof FormData) {
xhr.setRequestHeader("Content-Type",
"multipart\/form-data; boundary=" + param.data.getBoundary());
param.data.pipe(buffer);
xhr.send(buffer.getContents());
param.data.pipe(buffer, {end: false});
param.data.on('end', function () {
xhr.send(buffer.getContentsAsString('utf-8'));
});
} else {
xhr.send(param.data);
}
......
......@@ -79,8 +79,10 @@
if (param.data instanceof FormData) {
xhr.setRequestHeader("Content-Type",
"multipart\/form-data; boundary=" + param.data.getBoundary());
param.data.pipe(buffer);
xhr.send(buffer.getContents());
param.data.pipe(buffer, {end: false});
param.data.on('end', function () {
xhr.send(buffer.getContentsAsString('utf-8'));
});
} else {
xhr.send(param.data);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment