diff --git a/package.json b/package.json index 3c6d4bb4..223c980c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@erc725/erc725.js", - "version": "0.27.2", + "version": "0.27.3", "description": "Library to interact with ERC725 smart contracts", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts", diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 66b8eddf..d156d564 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -613,7 +613,9 @@ export function patchIPFSUrlsIfApplicable( receivedData: URLDataWithHash, ipfsGateway: string, ): URLDataWithHash { - if (receivedData?.url?.indexOf('ipfs://') !== -1) { + // Only map URL if it's indeed an ipfs:// URL and ignore if it's a data:// URL with JSON + // possibly containing an IPFS URL inside of the JSON data. + if (receivedData?.url?.startsWith('ipfs://')) { return { ...receivedData, url: receivedData.url.replace('ipfs://', ipfsGateway),