diff --git a/package.json b/package.json index 3b7ba54fb0..7736c2e47b 100644 --- a/package.json +++ b/package.json @@ -204,7 +204,7 @@ "execa": "^3.0.0", "form-data": "^2.5.1", "hat": "0.0.3", - "interface-ipfs-core": "^0.118.0", + "interface-ipfs-core": "^0.119.0", "ipfs-interop": "^0.1.1", "ipfsd-ctl": "^0.47.2", "libp2p-websocket-star": "~0.10.2", diff --git a/src/core/components/dht.js b/src/core/components/dht.js index 78ca7fbf6d..b4d861a26a 100644 --- a/src/core/components/dht.js +++ b/src/core/components/dht.js @@ -119,6 +119,16 @@ module.exports = (self) => { if (!Array.isArray(keys)) { keys = [keys] } + for (var i in keys) { + if (typeof keys[i] === 'string') { + try { + keys[i] = new CID(keys[i]) + } catch (err) { + log.error(err) + throw errcode(err, 'ERR_INVALID_CID') + } + } + } // ensure blocks are actually local const has = await every(keys, (key) => {