Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
fix: BREAKING CHANGE use data-encoding arg so data is not corrupted (#…
Browse files Browse the repository at this point in the history
…806)

BREAKING CHANGE: Requires go-ipfs 0.4.17 as it allows for specifying the data encoding format when requesting object data.
  • Loading branch information
achingbrain authored and alanshaw committed Aug 14, 2018
1 parent b2a77d6 commit 553c3fb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/object/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,17 @@ module.exports = (send) => {

send({
path: 'object/get',
args: cidB58Str
args: cidB58Str,
qs: {
'data-encoding': 'base64'
}
}, (err, result) => {
if (err) {
return callback(err)
}

result.Data = Buffer.from(result.Data, 'base64')

const links = result.Links.map((l) => {
return new DAGLink(l.Name, l.Size, Buffer.from(bs58.decode(l.Hash)))
})
Expand Down

0 comments on commit 553c3fb

Please sign in to comment.