Skip to content

Commit

Permalink
feat: allow passing a dedicated managed gateway for ipfs
Browse files Browse the repository at this point in the history
  • Loading branch information
aramalipoor committed Dec 17, 2022
1 parent b4103a0 commit 614ba4a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/ipfs/src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
export const normalizeIpfsUrl = (
uri?: string,
preferManagedGateway?: boolean,
preferManagedGateway?: boolean | string,
) =>
uri?.replace(
/^ipfs:\/\//i,
preferManagedGateway
preferManagedGateway === true
? 'https://ipfs.flair.finance/ipfs/'
: preferManagedGateway
? `${preferManagedGateway}`
: 'https://cloudflare-ipfs.com/ipfs/',
);

0 comments on commit 614ba4a

Please sign in to comment.