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

fix: also retry with misnamed format "dag-cbor" as "cbor" #888

Merged
merged 1 commit into from
Nov 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/block/put.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ module.exports = (send) => {

sendOneFile(block.data, { qs }, (err, result) => {
if (err) {
// Retry with "protobuf" format for go-ipfs
// Retry with "protobuf"/"cbor" format for go-ipfs
// TODO: remove when https://github.com/ipfs/go-cid/issues/75 resolved
if (qs.format === 'dag-pb') {
qs.format = 'protobuf'
if (qs.format === 'dag-pb' || qs.format === 'dag-cbor') {
qs.format = qs.format === 'dag-pb' ? 'protobuf' : 'cbor'
return sendOneFile(block.data, { qs }, (err, result) => {
if (err) return callback(err)
callback(null, new Block(block.data, new CID(result.Key)))
Expand Down