fix: restored object to preserve x-amz-meta properly (#13664)

with SelectRestoreRequest OutputLocation provides
additional metadata for the object, this is not
preserved due to argument order change.
This commit is contained in:
Harshavardhana 2021-11-15 13:25:55 -08:00 committed by GitHub
parent 4545ecad58
commit 7752cdbfaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -550,7 +550,7 @@ func putRestoreOpts(bucket, object string, rreq *RestoreObjectRequest, objInfo O
if rreq.Type == SelectRestoreRequest { if rreq.Type == SelectRestoreRequest {
for _, v := range rreq.OutputLocation.S3.UserMetadata { for _, v := range rreq.OutputLocation.S3.UserMetadata {
if !strings.HasPrefix("x-amz-meta", strings.ToLower(v.Name)) { if !strings.HasPrefix(strings.ToLower(v.Name), "x-amz-meta") {
meta["x-amz-meta-"+v.Name] = v.Value meta["x-amz-meta-"+v.Name] = v.Value
continue continue
} }