Open lumenpink opened 3 years ago
The trailing slash usually means that it's a directory. 🤔 From there it will look for an index.html
or similar to resolve to a file if it exists.
Could you point to an example URL with the trailing slash as well as which software it works in?
Here's an example URL which this happens with: ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi/
This is gonna be a bit hard because ipfs-fetch doesn't have a way to understand the mime type without a file extension at the moment. 🤔
Hi!
I found a little Bug in this implementation when the URL have a trailing slash
The script enters in this IF and treats the answer like a directory and not a file. I tested locking it as always false and it runs OK.
https://github.com/RangerMauve/js-ipfs-fetch/blob/631127a8568aecab8f497c4cf6149162b87ebf8f/index.js#L129