Skip to content

Commit

Permalink
improve url origin verification (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtanrikulu committed Dec 1, 2023
1 parent 7d5c3f0 commit 20ee5bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,5 +1,5 @@
{
"version": "0.3.4",
"version": "0.3.5",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.esm.js",
Expand Down
4 changes: 2 additions & 2 deletions src/specs/erc1155.ts
Expand Up @@ -11,7 +11,7 @@ const abi = [

function getMarketplaceAPIKey(uri: string, options?: AvatarResolverOpts) {
if (
uri.startsWith('https://api.opensea.io') &&
uri.startsWith('https://api.opensea.io/') &&
options?.apiKey?.['opensea']
) {
return { 'X-API-KEY': options.apiKey.opensea };
Expand All @@ -28,7 +28,7 @@ export default class ERC1155 {
options?: AvatarResolverOpts
) {
// exclude opensea api which does not follow erc1155 spec
const tokenIDHex = !tokenID.startsWith('https://api.opensea.io')
const tokenIDHex = !tokenID.startsWith('https://api.opensea.io/')
? tokenID.replace('0x', '').padStart(64, '0')
: tokenID;
const contract = new Contract(contractAddress, abi, provider);
Expand Down

0 comments on commit 20ee5bc

Please sign in to comment.