diff --git a/packages/interface-ipfs-core/src/dag/get.js b/packages/interface-ipfs-core/src/dag/get.js index c8a1cbfbbd..b88a6fa729 100644 --- a/packages/interface-ipfs-core/src/dag/get.js +++ b/packages/interface-ipfs-core/src/dag/get.js @@ -147,6 +147,11 @@ module.exports = (common, options) => { expect(result.value.equals(cidPb)).to.be.true() }) + it('should get with options and no path', async function () { + const result = await ipfs.dag.get(cidCbor, { localResolve: true }) + expect(result.value).to.deep.equal(nodeCbor) + }) + it('should get a node added as CIDv0 with a CIDv1', async () => { const input = Buffer.from(`TEST${Math.random()}`) diff --git a/packages/ipfs-http-client/src/dag/get.js b/packages/ipfs-http-client/src/dag/get.js index 8a82385d6e..3e2f8a79e3 100644 --- a/packages/ipfs-http-client/src/dag/get.js +++ b/packages/ipfs-http-client/src/dag/get.js @@ -16,7 +16,7 @@ module.exports = configure((api, options) => { const dagResolve = require('./resolve')(options) return async (cid, path, options = {}) => { - if (typeof path === 'object') { + if (path && typeof path === 'object') { options = path path = null }