ipfs-utils
Advanced tools
Comparing version 1.2.2 to 1.2.3
@@ -0,1 +1,11 @@ | ||
<a name="1.2.3"></a> | ||
## [1.2.3](https://github.com/ipfs/js-ipfs-utils/compare/v1.2.2...v1.2.3) (2020-04-07) | ||
### Bug Fixes | ||
* destroy request body when we are aborting it midway though r… ([#31](https://github.com/ipfs/js-ipfs-utils/issues/31)) ([1f7506d](https://github.com/ipfs/js-ipfs-utils/commit/1f7506d)) | ||
<a name="1.2.2"></a> | ||
@@ -2,0 +12,0 @@ ## [1.2.2](https://github.com/ipfs/js-ipfs-utils/compare/v1.2.1...v1.2.2) (2020-04-06) |
{ | ||
"name": "ipfs-utils", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "Package to aggregate shared logic and dependencies for the IPFS ecosystem", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -265,2 +265,23 @@ /* eslint-disable no-undef */ | ||
if (isAsyncIterator(source)) { | ||
// Workaround for https://github.com/node-fetch/node-fetch/issues/766 | ||
if (source.writable && source.readable) { | ||
const iter = source[Symbol.asyncIterator]() | ||
const wrapper = { | ||
next: iter.next.bind(iter), | ||
return: () => { | ||
if (source.writableEnded) { | ||
source.destroy() | ||
} | ||
return iter.return() | ||
}, | ||
[Symbol.asyncIterator]: () => { | ||
return wrapper | ||
} | ||
} | ||
return wrapper | ||
} | ||
return source | ||
@@ -267,0 +288,0 @@ } |
54311
948