Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fixup! feat!: update http-server DAG API to match [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Oct 12, 2021
1 parent 23d2268 commit 0a4622b
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions packages/ipfs-http-server/src/api/resources/dag.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,7 @@ export const putResource = {
throw Boom.badRequest("File argument 'object data' is required")
}

const cidVersion = request.query.storeCodec === 'dag-pb' && request.query.hashAlg === 'sha2-256' ? request.query.version : 1

return {
data,
cidVersion
}
return { data }
}
}],
validate: {
Expand Down Expand Up @@ -190,8 +185,7 @@ export const putResource = {
},
pre: {
args: {
data,
cidVersion,
data
}
},
query: {
Expand All @@ -200,11 +194,13 @@ export const putResource = {
hashAlg,
pin,
cidBase,
timeout,
version
version,
timeout
}
} = request

const cidVersion = storeCodec === 'dag-pb' && hashAlg === 'sha2-256' ? version : 1

let cid

try {
Expand Down

0 comments on commit 0a4622b

Please sign in to comment.