We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Heads up:
ipfs://
This code assumes every CID is CIDv0 (looks the same as Multihash, so it is parsed as Multihash here):
public InputStream getInputStream() throws IOException { Multihash filePointer = Multihash.fromBase58(location.toString().replaceFirst("ipfs://", "")); byte[] fileContents = new byte[0]; try { fileContents = ipfs.cat(filePointer); } catch (IOException e) { logger.error("Failed to retrieve object", e); return null; }
Try parsing ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi – it is not Base58 (it is CIDv1 in Base32), so will throw an exception.
ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi
Always assume localtion is a CID and parse it using a library that understands CIDv1.
localtion
You can use CID implementation from java-cid, you can also peek at how CIDs are used in Peergos
See:
Happy to answer any questions / guide
cc @rlebre for awareness
The text was updated successfully, but these errors were encountered:
Thank you very much for the heads up @lidel. I'll look into this soon and definitely reach you if a technical issue arises. Thanks!
Sorry, something went wrong.
No branches or pull requests
Summary
Heads up:
ipfs://
addresses in this project will break when it attempts to read a CIDv1ipfs://
addressesProblem
This code assumes every CID is CIDv0 (looks the same as Multihash, so it is parsed as Multihash here):
Try parsing
ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi
– it is not Base58 (it is CIDv1 in Base32), so will throw an exception.Solution
Always assume
localtion
is a CID and parse it using a library that understands CIDv1.You can use CID implementation from java-cid, you can also peek at how CIDs are used in Peergos
See:
Happy to answer any questions / guide
cc @rlebre for awareness
The text was updated successfully, but these errors were encountered: