mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
obj: support object names with curly braces. (#1429)
Example files like ``` /usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/ubufox@ubuntu.com.xpi Song's Son.ogg ``` Should be supported.
This commit is contained in:
parent
a978975eea
commit
27c50a70cc
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user