From a39b965bea3bfb402cad0be7cdab2accc2ce521c Mon Sep 17 00:00:00 2001 From: Andreas Richter <708186+richtera@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:50:10 -0400 Subject: [PATCH 1/3] fix: Make explicitely sure that method === 0x0000000 is also ignored in isDataAuthentic --- src/lib/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 14fa11fc..66b8eddf 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -550,7 +550,7 @@ export function isDataAuthentic( options: Verification, capture?: string[], ): boolean { - if (!options || !options.method) { + if (!options?.method || options?.method === '0x00000000') { return true; } From f5402b854f0b23de2867a172f1e21e56bba44070 Mon Sep 17 00:00:00 2001 From: Andreas Richter <708186+richtera@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:54:27 -0400 Subject: [PATCH 2/3] fix: Compile temporary patch --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 31307b66..3c6d4bb4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@erc725/erc725.js", - "version": "0.24.0", + "version": "0.27.2", "description": "Library to interact with ERC725 smart contracts", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts", From 27da039ca7055875e7bea5b129987f1da5b90376 Mon Sep 17 00:00:00 2001 From: Andreas Richter <708186+richtera@users.noreply.github.com> Date: Tue, 17 Sep 2024 10:11:52 -0400 Subject: [PATCH 3/3] fix: Repair patchIPFSUtlsIfApplication to only replace if the URL starts with ipfs:// --- src/lib/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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),