mirror of
https://github.com/minio/minio.git
synced 2025-02-28 05:49:16 -05:00
Add missing comment key from key list (#9313)
Continuing from previous PR #9304, comment is a special key is not present in the default KV list. Add it explicitly when tokenizing fields as it may be possible that some clients might try to set comments.
This commit is contained in:
parent
79bcb705bf
commit
b412a222ae
@ -200,9 +200,17 @@ func (kvs KVS) Empty() bool {
|
||||
// Keys returns the list of keys for the current KVS
|
||||
func (kvs KVS) Keys() []string {
|
||||
var keys = make([]string, len(kvs))
|
||||
var foundComment bool
|
||||
for i := range kvs {
|
||||
if kvs[i].Key == madmin.CommentKey {
|
||||
foundComment = true
|
||||
}
|
||||
keys[i] = kvs[i].Key
|
||||
}
|
||||
// Comment KV not found, add it explicitly.
|
||||
if !foundComment {
|
||||
keys = append(keys, madmin.CommentKey)
|
||||
}
|
||||
return keys
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user