Changing to empty response when prefixDir doesn't exist

This commit is contained in:
Karthic Rao
2016-03-23 04:33:08 +05:30
parent 600a932acb
commit 7be79b507b
3 changed files with 36 additions and 9 deletions

View File

@@ -51,3 +51,15 @@ func IsValidObjectName(object string) bool {
}
return true
}
// IsValidObjectPrefix verifies whether the prefix is a valid object name.
// Its valid to have a empty prefix.
func IsValidObjectPrefix(object string) bool {
// Prefix can be empty.
if object == "" {
return true
}
// Verify if prefix is a valid object name.
return IsValidObjectName(object)
}