mirror of
https://github.com/versity/versitygw.git
synced 2026-09-26 01:44:49 +00:00
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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user