diff --git a/package.json b/package.json index 769d31cc2..0f2086c1b 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "go-ipfs-dep": "^0.4.13", "gulp": "^3.9.1", "hapi": "^17.2.3", - "interface-ipfs-core": "~0.56.5", + "interface-ipfs-core": "~0.58.0", "ipfs": "~0.28.2", "ipfsd-ctl": "~0.30.1", "pre-commit": "^1.2.2", diff --git a/src/utils/clean-cid.js b/src/utils/clean-cid.js index f73a1e004..dbc8386ee 100644 --- a/src/utils/clean-cid.js +++ b/src/utils/clean-cid.js @@ -7,6 +7,9 @@ module.exports = function (cid) { if (Buffer.isBuffer(cid)) { cid = bs58.encode(cid) } + if (CID.isCID(cid)) { + cid = cid.toBaseEncodedString() + } if (typeof cid !== 'string') { throw new Error('unexpected cid type: ' + typeof cid) }