Explorar o código

Prevent prefix from being applied twice to files

Signed-off-by: Sean Holcomb <seanholcomb@gmail.com>
Sean Holcomb %!s(int64=2) %!d(string=hai) anos
pai
achega
260a624aa5
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      pkg/storage/prefixedbucketstorage.go

+ 1 - 1
pkg/storage/prefixedbucketstorage.go

@@ -32,7 +32,7 @@ func validPrefix(prefix string) bool {
 }
 }
 
 
 func conditionalPrefix(prefix, name string) string {
 func conditionalPrefix(prefix, name string) string {
-	if len(name) > 0 {
+	if len(name) > 0 && !strings.HasPrefix(name, prefix) {
 		return withPrefix(prefix, name)
 		return withPrefix(prefix, name)
 	}
 	}