Skip to content

Commit

Permalink
add check to all patch commands
Browse files Browse the repository at this point in the history
  • Loading branch information
schomatis committed Sep 23, 2021
1 parent e16bc39 commit 6374c6d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions core/commands/object/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ DEPRECATED and provided for legacy reasons. Use 'ipfs add' or 'ipfs files' inste
return err
}

if err := checkBlockSize(req, p.Cid(), api.Dag()); err != nil {
return err
}

return cmds.EmitOnce(res, &Object{Hash: p.Cid().String()})
},
Type: &Object{},
Expand Down Expand Up @@ -138,6 +142,10 @@ DEPRECATED and provided for legacy reasons. Use 'files cp' and 'dag put' instead
return err
}

if err := checkBlockSize(req, p.Cid(), api.Dag()); err != nil {
return err
}

return cmds.EmitOnce(res, &Object{Hash: p.Cid().String()})
},
Type: Object{},
Expand Down Expand Up @@ -176,6 +184,10 @@ DEPRECATED and provided for legacy reasons. Use 'files rm' instead.
return err
}

if err := checkBlockSize(req, p.Cid(), api.Dag()); err != nil {
return err
}

return cmds.EmitOnce(res, &Object{Hash: p.Cid().String()})
},
Type: Object{},
Expand Down

0 comments on commit 6374c6d

Please sign in to comment.