dipdup-io / metadata

Tezos TZIP-16/TZIP-12 metadata indexer
https://ide.dipdup.io/?resource=https://metadata.dipdup.net/v1/graphql
17 stars 4 forks source link

Url encoding issues #25

Open 852Kerfunkle opened 2 years ago

852Kerfunkle commented 2 years ago

Some IPFS links won't resolve because the url isn't encoded properly.

For example ipfs://bafybeid5xl7cwdaelgh2rrxeicul6v7xbuwvtgiywklui43todymiyxx3y/TZLAND#247_FINALE.glb (just imagine this could be a json file for the sake of this ticket) will fail to fetch because the # isn't url encoded. Filenames containing spaces appear to work fine, though.

Tried fixing this but I can't quite figure out where that goes wrong and adding additional url encoding causes spaces to be double url encoded (%2520).

Thanks!

852Kerfunkle commented 2 years ago

Ok, so part of the problem is on my end (urls in metadata not being properly encoded), but there's definitely also an issue here: unencoded urls not being encoded before requests.

I suppose a possible solution would be to url decode links and then url encode them again to make sure to catch half, badly or un-encoded urls.