ferristseng / rust-ipfs-api

IPFS HTTP client in Rust
Apache License 2.0
246 stars 68 forks source link

`get` vs `cat`, `get` possibly returns TAR #111

Open mrd0ll4r opened 1 year ago

mrd0ll4r commented 1 year ago

I noticed a difference in the data I get with get vs cat. Using this example CID, QmYPP3BovR2m8UqCZxFbdXSit6SKgExxDkFAPLqiGsap4X, which is 17091 bytes (confirmed via ipfs get and ipfs cat using go-ipfs v0.14.0):

get returns 18944 bytes, cat returns 17091 bytes. The extra bytes for get seem to be at the beginning, I believe the response is a TAR. MIME type detection tells me it's application/x-tar.

Looking at the corresponding Go client, they indeed extract the response through tar.

I opened an issue for this in the IPFS docs repo: https://github.com/ipfs/ipfs-docs/issues/1285