@cryptotaxi247 / kubo / commits / cc2ab147a

commands(dht): load arguments from request body

License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>

Steven Allen committed Apr 30, 2019 at 01:06 UTC cc2ab147abddd9c74256eae653f32aba5b21110a
1 file changed +13
core/commands/dht.go
+13
@@ -241,6 +241,13 @@ var provideRefDhtCmd = &cmds.Command{
241 return errors.New("cannot provide, no connected peers")
242 }
243
244 + // Needed to parse stdin args.
245 + // TODO: Lazy Load
246 + err = req.ParseBodyArgs()
247 + if err != nil {
248 + return err
249 + }
250 +
251 rec, _ := req.Options[recursiveOptionName].(bool)
252
253 var cids []cid.Cid
@@ -542,6 +549,12 @@ NOTE: A value may not exceed 2048 bytes.
549 return err
550 }
551
552 + // Needed to parse stdin args.
553 + err = req.ParseBodyArgs()
554 + if err != nil {
555 + return err
556 + }
557 +
558 if !nd.IsOnline {
559 return ErrNotOnline
560 }