@cryptotaxi247 / kubo / commits / 049bca6d0

bandaid it instead

License: MIT Signed-off-by: Mateja Milosevic <minima38123@gmail.com>

Quantomic committed Jul 14, 2017 at 20:04 UTC 049bca6d09b785577544c869c4513880b9460af2
2 files changed +5 -4
commands/http/parse.go
-4
@@ -122,10 +122,6 @@ func Parse(r *http.Request, root *cmds.Command) (cmds.Request, error) {
122 return nil, fmt.Errorf("File argument '%s' is required", requiredFile)
123 }
124
125 - if f != nil && f.FullPath() == "" {
126 - return nil, fmt.Errorf("Corrupted data passed as file argument")
127 - }
128 -
125 req, err := cmds.NewRequest(pth, opts, args, f, cmd, optDefs)
126 if err != nil {
127 return nil, err
core/coreunix/add.go
+5
@@ -223,6 +223,11 @@ func (adder *Adder) Finalize() (node.Node, error) {
223 if err != nil {
224 return nil, err
225 }
226 +
227 + if len(children) == 0 {
228 + return nil, fmt.Errorf("expected at least one child dir, got none")
229 + }
230 +
231 name = children[0]
232
233 mr, err := adder.mfsRoot()