forked from TrueCloudLab/frostfs-s3-gw
[#318] Add x-amz-version-id header
Support version id in CompleteMultipartUpload method Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
8872b6f196
commit
e8e07147a8
1 changed files with 6 additions and 0 deletions
|
@ -458,6 +458,12 @@ func (h *handler) CompleteMultipartUploadHandler(w http.ResponseWriter, r *http.
|
|||
Key: objInfo.Name,
|
||||
}
|
||||
|
||||
if versioning, err := h.obj.GetBucketVersioning(r.Context(), reqInfo.BucketName); err != nil {
|
||||
h.log.Warn("couldn't get bucket versioning", zap.String("bucket name", reqInfo.BucketName), zap.Error(err))
|
||||
} else if versioning.VersioningEnabled {
|
||||
w.Header().Set(api.AmzVersionID, objInfo.Version())
|
||||
}
|
||||
|
||||
if err = api.EncodeToResponse(w, response); err != nil {
|
||||
h.logAndSendError(w, "something went wrong", reqInfo, err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue