Support creating directories on erasure coded backend (#5443)

This PR continues from #5049 where we started supporting
directories for erasure coded backend
This commit is contained in:
Harshavardhana
2018-01-29 18:43:13 -08:00
committed by Nitish Tiwari
parent 45c35b3544
commit 3ea28e9771
11 changed files with 155 additions and 72 deletions

View File

@@ -38,11 +38,10 @@ func checkBucketAndObjectNames(bucket, object string) error {
return errors.Trace(BucketNameInvalid{Bucket: bucket})
}
// Verify if object is valid.
if !IsValidObjectName(object) {
// Objects with "/" are invalid, verify to return a different error.
if hasSuffix(object, slashSeparator) || hasPrefix(object, slashSeparator) {
return errors.Trace(ObjectNotFound{Bucket: bucket, Object: object})
}
if len(object) == 0 {
return errors.Trace(ObjectNameInvalid{Bucket: bucket, Object: object})
}
if !IsValidObjectPrefix(object) {
return errors.Trace(ObjectNameInvalid{Bucket: bucket, Object: object})
}
return nil