@cryptotaxi247 / kubo / commits / 83cda2e69

commands/http: Fixed arg parse bug

Matt Bell committed Nov 4, 2014 at 23:40 UTC 83cda2e699598d65afa48ac0372e4fc9bea58944
1 file changed +2 -1
commands/http/parse.go
+2 -1
@@ -61,17 +61,18 @@ func Parse(r *http.Request, root *cmds.Command) (cmds.Request, error) {
61 if valCount <= lenRequired && !argDef.Required {
62 continue
63 }
64 - valCount--
64
65 if argDef.Type == cmds.ArgString {
66 if argDef.Variadic {
67 for _, s := range stringArgs {
68 args = append(args, s)
69 }
70 + valCount -= len(stringArgs)
71
72 } else if len(stringArgs) > 0 {
73 args = append(args, stringArgs[0])
74 stringArgs = stringArgs[1:]
75 + valCount--
76
77 } else {
78 break