api: Relax object name validation. (#2814)

Fixes #2812
This commit is contained in:
Harshavardhana
2016-09-30 16:56:36 -07:00
committed by GitHub
parent db3da97a50
commit 5ecba587f7
8 changed files with 18 additions and 16 deletions

View File

@@ -75,11 +75,8 @@ func IsValidBucketName(bucket string) bool {
// Rejects strings with following characters.
//
// - Backslash ("\")
// - Caret ("^")
// - Grave accent / back tick ("`")
// - Vertical bar / pipe ("|")
//
// Minio does not support object names with trailing "/".
// additionally minio does not support object names with trailing "/".
func IsValidObjectName(object string) bool {
if len(object) == 0 {
return false
@@ -103,7 +100,7 @@ func IsValidObjectPrefix(object string) bool {
return false
}
// Reject unsupported characters in object name.
if strings.ContainsAny(object, "`^|\\\"") {
if strings.ContainsAny(object, "\\") {
return false
}
return true