From 27c50a70cc04f043aabaaa45f298188e36ef00eb Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Fri, 29 Apr 2016 20:19:08 -0700 Subject: [PATCH] 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. --- object-utils.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/object-utils.go b/object-utils.go index aa2de285e..9fb41a6c1 100644 --- a/object-utils.go +++ b/object-utils.go @@ -65,13 +65,8 @@ func IsValidBucketName(bucket string) bool { // Rejects strings with following characters. // // - Backslash ("\") -// - Left curly brace ("{") // - Caret ("^") -// - Right curly brace ("}") // - Grave accent / back tick ("`") -// - Tilde ("~") -// - 'Greater Than' symbol (">") -// - 'Less Than' symbol ("<") // - Vertical bar / pipe ("|") func IsValidObjectName(object string) bool { if len(object) > 1024 || len(object) == 0 { @@ -81,7 +76,7 @@ func IsValidObjectName(object string) bool { return false } // Reject unsupported characters in object name. - return !strings.ContainsAny(object, "`^*{}|\\\"'") + return !strings.ContainsAny(object, "`^*|\\\"") } // IsValidObjectPrefix verifies whether the prefix is a valid object name.