diff --git a/packages/client/src/gateway.js b/packages/client/src/gateway.js index 74354ecae7..11a3902841 100644 --- a/packages/client/src/gateway.js +++ b/packages/client/src/gateway.js @@ -1,4 +1,4 @@ -export const GATEWAY = new URL('https://dweb.link/') +export const GATEWAY = new URL('https://nftstorage.link/') /** * @typedef {string|URL} GatewayURL Base URL of an IPFS Gateway e.g. https://dweb.link/ or https://ipfs.io/ @@ -12,7 +12,7 @@ export const GATEWAY = new URL('https://dweb.link/') * * @param {string|URL} url An IPFS URL e.g. ipfs://bafy.../path * @param {GatewayURLOptions} [options] Options that allow customization of the gateway used. - * @returns {URL} An IPFS gateway URL e.g. https://dweb.link/ipfs/bafy.../path + * @returns {URL} An IPFS gateway URL e.g. https://nftstorage.link/ipfs/bafy.../path */ export const toGatewayURL = (url, options = {}) => { const gateway = options.gateway || GATEWAY diff --git a/packages/client/test/gateway.spec.js b/packages/client/test/gateway.spec.js index 16fd44d1cc..3a83b341b9 100644 --- a/packages/client/test/gateway.spec.js +++ b/packages/client/test/gateway.spec.js @@ -7,14 +7,14 @@ const filename = 'yesthisisdog.jpg' describe('toGatewayURL', () => { it('converts ipfs:// URL to a gateway URL', () => { const ipfsURL = new URL(`ipfs://${cid}/${filename}`) - const gwURL = new URL(`https://dweb.link/ipfs/${cid}/${filename}`) + const gwURL = new URL(`https://nftstorage.link/ipfs/${cid}/${filename}`) const result = toGatewayURL(ipfsURL) assert.equal(result.href, gwURL.href) }) it('converts ipfs:// URL (as string) to a gateway URL', () => { const ipfsURLStr = `ipfs://${cid}/${filename}` - const gwURL = new URL(`https://dweb.link/ipfs/${cid}/${filename}`) + const gwURL = new URL(`https://nftstorage.link/ipfs/${cid}/${filename}`) const result = toGatewayURL(ipfsURLStr) assert.equal(result.href, gwURL.href) }) diff --git a/packages/client/test/lib.spec.js b/packages/client/test/lib.spec.js index fb565b8e89..c2d5bc0a7a 100644 --- a/packages/client/test/lib.spec.js +++ b/packages/client/test/lib.spec.js @@ -10,7 +10,7 @@ import { CarWriter } from '@ipld/car' import * as dagJson from '@ipld/dag-json' import { randomCar } from './helpers.js' -const DWEB_LINK = 'dweb.link' +const GATEWAY_LINK = 'nftstorage.link' describe('client', () => { const { AUTH_TOKEN, SERVICE_ENDPOINT } = process.env @@ -481,7 +481,7 @@ describe('client', () => { assert.equal(embed.description, 'stuff') assert.ok(embed.image instanceof URL) assert.ok(embed.image.protocol, 'https:') - assert.ok(embed.image.host, DWEB_LINK) + assert.ok(embed.image.host, GATEWAY_LINK) assert.equal(embed.properties.extra, 'meta') assert.ok(Array.isArray(embed.properties.src)) @@ -490,11 +490,11 @@ describe('client', () => { const [h2, b2] = /** @type {[URL, URL]} */ (embed.properties.src) assert.ok(h2 instanceof URL) assert.equal(h2.protocol, 'https:') - assert.equal(h2.host, DWEB_LINK) + assert.equal(h2.host, GATEWAY_LINK) assert.ok(b2 instanceof URL) assert.equal(b2.protocol, 'https:') - assert.equal(b2.host, DWEB_LINK) + assert.equal(b2.host, GATEWAY_LINK) }) it('store with OpenSea extensions', async () => {