diff --git a/package.json b/package.json index 737ef9cbad..b758316f34 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "execa": "^1.0.0", "form-data": "^2.3.3", "hat": "0.0.3", - "interface-ipfs-core": "~0.97.1", + "interface-ipfs-core": "~0.98.1", "ipfsd-ctl": "~0.41.0", "libp2p-websocket-star": "~0.10.2", "ncp": "^2.0.0", diff --git a/src/core/components/files-regular/cat-pull-stream.js b/src/core/components/files-regular/cat-pull-stream.js index 41c126e8d3..ceecff97e8 100644 --- a/src/core/components/files-regular/cat-pull-stream.js +++ b/src/core/components/files-regular/cat-pull-stream.js @@ -15,8 +15,7 @@ module.exports = function (self) { ipfsPath = normalizePath(ipfsPath) const pathComponents = ipfsPath.split('/') - const restPath = normalizePath(pathComponents.slice(1).join('/')) - const filterFile = (file) => (restPath && file.path === restPath) || (file.path === ipfsPath) + const fileNameOrHash = pathComponents[pathComponents.length - 1] if (options.preload !== false) { self._preload(pathComponents[0]) @@ -26,7 +25,7 @@ module.exports = function (self) { pull( exporter(ipfsPath, self._ipld, options), - pull.filter(filterFile), + pull.filter(file => file.path === fileNameOrHash), pull.take(1), pull.collect((err, files) => { if (err) {