Explorar o código

Merge pull request #2734 from Sean-Holcomb/sth/prefix-bucket-fix

Prevent prefix from being applied twice to files
Sean Holcomb %!s(int64=2) %!d(string=hai) anos
pai
achega
540d5973de
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)
 	}
 	}