diff --git a/src/url-utils.js b/src/url-utils.js index 25c3073..e083899 100644 --- a/src/url-utils.js +++ b/src/url-utils.js @@ -18,7 +18,7 @@ const gatewayHttpUrl = (cid, gatewayProvider = 'ipfs') => { return origin } - return `${origin}/ipfs/${cid}` + return `${origin}/ipfs/${cid}/` } const linkCid = (cid, gatewayProvider) => `🔗 ${chalk.green( diff --git a/test/url-utils.js b/test/url-utils.js index 971ce3d..9ef5205 100644 --- a/test/url-utils.js +++ b/test/url-utils.js @@ -3,19 +3,19 @@ const proxyquire = require('proxyquire').noCallThru() const { gatewayHttpUrl } = require('../src/url-utils') test('get http gateway url for a cid', t => { - const expected = 'https://ipfs.io/ipfs/fakecid' + const expected = 'https://ipfs.io/ipfs/fakecid/' const actual = gatewayHttpUrl('fakecid') t.is(actual, expected) }) test('get http gateway url for a cid on infura', t => { - const expected = 'https://ipfs.infura.io/ipfs/fakecid' + const expected = 'https://ipfs.infura.io/ipfs/fakecid/' const actual = gatewayHttpUrl('fakecid', 'infura') t.is(actual, expected) }) test('get http gateway url for a cid on pinata', t => { - const expected = 'https://gateway.pinata.cloud/ipfs/fakecid' + const expected = 'https://gateway.pinata.cloud/ipfs/fakecid/' const actual = gatewayHttpUrl('fakecid', 'pinata') t.is(actual, expected) })