Skip to content

Commit 6cf66c0

Browse files
author
Antonio Tenorio Fornés
committed
add json input enc to dag put method
1 parent f63e391 commit 6cf66c0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/api/dag.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ module.exports = (send) => {
3333
}
3434

3535
function prepare () {
36+
if (format === 'json') {
37+
format = 'cbor'
38+
inputEnc = 'json'
39+
40+
finalize(null, new Buffer(JSON.stringify(dagNode)))
41+
}
3642
if (format === 'dag-cbor') {
3743
// TODO change this once
3844
// https://github.com/ipfs/go-ipfs/issues/3771 is finished

0 commit comments

Comments
 (0)