Skip to content

Commit

Permalink
ignore buffers recalculation
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmywarting committed Apr 15, 2019
1 parent e996bda commit bee2ad8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/blob.js
Expand Up @@ -12,6 +12,7 @@ export default class Blob {
const options = arguments[1];

const buffers = [];
let size = 0;

if (blobParts) {
const a = blobParts;
Expand All @@ -30,6 +31,7 @@ export default class Blob {
} else {
buffer = Buffer.from(typeof element === 'string' ? element : String(element));
}
size += buffer.length;
buffers.push(buffer);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/body.js
Expand Up @@ -258,7 +258,7 @@ function consumeBody() {
clearTimeout(resTimeout);

try {
resolve(Buffer.concat(accum));
resolve(Buffer.concat(accum, accumBytes));
} catch (err) {
// handle streams that have accumulated too much data (issue #414)
reject(new FetchError(`Could not create Buffer from response body for ${this.url}: ${err.message}`, 'system', err));
Expand Down

0 comments on commit bee2ad8

Please sign in to comment.