diff --git a/cmd/object-api-utils.go b/cmd/object-api-utils.go index 6891d95eb..c4f537351 100644 --- a/cmd/object-api-utils.go +++ b/cmd/object-api-utils.go @@ -170,6 +170,13 @@ func IsValidObjectPrefix(object string) bool { if strings.Contains(object, `//`) { return false } + // This is valid for AWS S3 but it will never + // work with file systems, we will reject here + // to return object name invalid rather than + // a cryptic error from the file system. + if strings.ContainsRune(object, 0) { + return false + } return true }