|
|
@ -65,13 +65,8 @@ func IsValidBucketName(bucket string) bool { |
|
|
|
// Rejects strings with following characters.
|
|
|
|
// Rejects strings with following characters.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// - Backslash ("\")
|
|
|
|
// - Backslash ("\")
|
|
|
|
// - Left curly brace ("{")
|
|
|
|
|
|
|
|
// - Caret ("^")
|
|
|
|
// - Caret ("^")
|
|
|
|
// - Right curly brace ("}")
|
|
|
|
|
|
|
|
// - Grave accent / back tick ("`")
|
|
|
|
// - Grave accent / back tick ("`")
|
|
|
|
// - Tilde ("~")
|
|
|
|
|
|
|
|
// - 'Greater Than' symbol (">")
|
|
|
|
|
|
|
|
// - 'Less Than' symbol ("<")
|
|
|
|
|
|
|
|
// - Vertical bar / pipe ("|")
|
|
|
|
// - Vertical bar / pipe ("|")
|
|
|
|
func IsValidObjectName(object string) bool { |
|
|
|
func IsValidObjectName(object string) bool { |
|
|
|
if len(object) > 1024 || len(object) == 0 { |
|
|
|
if len(object) > 1024 || len(object) == 0 { |
|
|
@ -81,7 +76,7 @@ func IsValidObjectName(object string) bool { |
|
|
|
return false |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
// Reject unsupported characters in object name.
|
|
|
|
// Reject unsupported characters in object name.
|
|
|
|
return !strings.ContainsAny(object, "`^*{}|\\\"'") |
|
|
|
return !strings.ContainsAny(object, "`^*|\\\"") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// IsValidObjectPrefix verifies whether the prefix is a valid object name.
|
|
|
|
// IsValidObjectPrefix verifies whether the prefix is a valid object name.
|
|
|
|