fs/erasure: Ignore objects with / even for DeleteObject() (#4303)

Additionally GetObject() also returns errFileNotFound similar
to HeadObject().

Fixes #4302
This commit is contained in:
Harshavardhana
2017-05-09 14:32:24 -07:00
committed by GitHub
parent fc774957fe
commit 298b470f69
6 changed files with 44 additions and 19 deletions

View File

@@ -73,9 +73,9 @@ func TestXLDeleteObjectBasic(t *testing.T) {
{".test", "obj", BucketNameInvalid{Bucket: ".test"}},
{"----", "obj", BucketNameInvalid{Bucket: "----"}},
{"bucket", "", ObjectNameInvalid{Bucket: "bucket", Object: ""}},
{"bucket", "obj/", ObjectNameInvalid{Bucket: "bucket", Object: "obj/"}},
{"bucket", "/obj", ObjectNameInvalid{Bucket: "bucket", Object: "/obj"}},
{"bucket", "doesnotexist", ObjectNotFound{Bucket: "bucket", Object: "doesnotexist"}},
{"bucket", "obj/", ObjectNotFound{Bucket: "bucket", Object: "obj/"}},
{"bucket", "/obj", ObjectNotFound{Bucket: "bucket", Object: "/obj"}},
{"bucket", "obj", nil},
}