Skip to content

Commit

Permalink
fix: cid check.
Browse files Browse the repository at this point in the history
  • Loading branch information
cody.meng committed Dec 19, 2024
1 parent 53e5f5c commit 1debbef
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/commands/cidstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@ var addCidCmd = &cmds.Command{
return cmds.EmitOnce(res, "Add batch ok.")
}

err = nd.Repo.Datastore().Put(req.Context, datastore.NewKey(NewGatewayFilterKey(req.Arguments[0])),
cid := req.Arguments[0]
err = validateCIDs([]string{cid})
if err != nil {
return cmds.EmitOnce(res, err.Error())
}
err = nd.Repo.Datastore().Put(req.Context, datastore.NewKey(NewGatewayFilterKey(cid)),
[]byte(req.Arguments[0]))
if err != nil {
return cmds.EmitOnce(res, err.Error())
Expand Down

0 comments on commit 1debbef

Please sign in to comment.