Return version-id header in DeleteObject response (#11090)

even when the object version is non-existent

To make this consistent with aws behavior.

Co-authored-by: Poorna Krishnamoorthy <poorna@minio.io>
This commit is contained in:
Poorna Krishnamoorthy 2020-12-11 16:58:15 -08:00 committed by GitHub
parent 8f65aba04b
commit 9adc33efbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -943,6 +943,7 @@ func (er erasureObjects) DeleteObjects(ctx context.Context, bucket string, objec
// response to the client request.
func (er erasureObjects) DeleteObject(ctx context.Context, bucket, object string, opts ObjectOptions) (objInfo ObjectInfo, err error) {
versionFound := true
objInfo = ObjectInfo{VersionID: opts.VersionID} // version id needed in Delete API response.
goi, gerr := er.GetObjectInfo(ctx, bucket, object, opts)
if gerr != nil && goi.Name == "" {
switch gerr.(type) {