fix: copy object missing prefix on metadata delete

When using the REPLACE directive, we were incorrectly removing the
old metadata on the object due to missing the metadata prefix on
the key.  Fix this to remove the correct metadata before setting
new metadata.

Fixes #787
This commit is contained in:
Ben McClelland
2024-09-07 17:06:45 -07:00
parent 66a7879b0a
commit ccd4166b2e
3 changed files with 62 additions and 10 deletions
+5 -2
View File
@@ -428,12 +428,15 @@ func getPtr(str string) *string {
return &str
}
// mp1 needs to be the response from the server
// mp2 needs to be the expected values
// The keys from the server are always converted to lowercase
func areMapsSame(mp1, mp2 map[string]string) bool {
if len(mp1) != len(mp2) {
return false
}
for key, val := range mp1 {
if mp2[key] != val {
for key, val := range mp2 {
if mp1[strings.ToLower(key)] != val {
return false
}
}