Skip to content

Commit

Permalink
Merge pull request #476 from ERC725Alliance/fix/isDataAuthentic
Browse files Browse the repository at this point in the history
Fix isDataAuthentic (bis)
  • Loading branch information
CJ42 authored Oct 23, 2024
2 parents 8d03cf4 + 27da039 commit 45b429d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
6 changes: 4 additions & 2 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ export function isDataAuthentic(
options: Verification,
capture?: string[],
): boolean {
if (!options || !options.method) {
if (!options?.method || options?.method === '0x00000000') {
return true;
}

Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 45b429d

Please sign in to comment.