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

Commit c1c1061

Browse files
committed
chore: use data-encoding arg to ensure data is not corrupted
1 parent a8f9a43 commit c1c1061

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/object/get.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,17 @@ module.exports = (send) => {
4141

4242
send({
4343
path: 'object/get',
44-
args: cidB58Str
44+
args: cidB58Str,
45+
qs: {
46+
'data-encoding': 'base64'
47+
}
4548
}, (err, result) => {
4649
if (err) {
4750
return callback(err)
4851
}
4952

53+
result.Data = Buffer.from(result.Data, 'base64')
54+
5055
const links = result.Links.map((l) => {
5156
return new DAGLink(l.Name, l.Size, Buffer.from(bs58.decode(l.Hash)))
5257
})

0 commit comments

Comments
 (0)