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

@@ -119,10 +119,7 @@ func IsValidObjectName(object string) bool {
if len(object) == 0 {
return false
}
if hasSuffix(object, slashSeparator) {
return false
}
if hasPrefix(object, slashSeparator) {
if hasSuffix(object, slashSeparator) || hasPrefix(object, slashSeparator) {
return false
}
return IsValidObjectPrefix(object)