mirror of
https://github.com/minio/minio.git
synced 2025-04-03 11:20:30 -04:00
Remove 'null' version ID from directory object response (#17495)
Fixes #17494 Regression from #17132
This commit is contained in:
parent
eefa047974
commit
216069d0da
@ -654,6 +654,11 @@ func (api objectAPIHandlers) DeleteMultipleObjectsHandler(w http.ResponseWriter,
|
|||||||
if deleteResult.errInfo.Code != "" {
|
if deleteResult.errInfo.Code != "" {
|
||||||
deleteErrors = append(deleteErrors, deleteResult.errInfo)
|
deleteErrors = append(deleteErrors, deleteResult.errInfo)
|
||||||
} else {
|
} else {
|
||||||
|
// All deletes on directory objects was with `nullVersionID`.
|
||||||
|
// Remove it from response.
|
||||||
|
if isDirObject(deleteResult.delInfo.ObjectName) && deleteResult.delInfo.VersionID == nullVersionID {
|
||||||
|
deleteResult.delInfo.VersionID = ""
|
||||||
|
}
|
||||||
deletedObjects = append(deletedObjects, deleteResult.delInfo)
|
deletedObjects = append(deletedObjects, deleteResult.delInfo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -669,6 +674,11 @@ func (api objectAPIHandlers) DeleteMultipleObjectsHandler(w http.ResponseWriter,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if replicateDeletes && (dobj.DeleteMarkerReplicationStatus() == replication.Pending || dobj.VersionPurgeStatus() == Pending) {
|
if replicateDeletes && (dobj.DeleteMarkerReplicationStatus() == replication.Pending || dobj.VersionPurgeStatus() == Pending) {
|
||||||
|
// copy so we can re-add null ID.
|
||||||
|
dobj := dobj
|
||||||
|
if isDirObject(dobj.ObjectName) && dobj.VersionID == "" {
|
||||||
|
dobj.VersionID = nullVersionID
|
||||||
|
}
|
||||||
dv := DeletedObjectReplicationInfo{
|
dv := DeletedObjectReplicationInfo{
|
||||||
DeletedObject: dobj,
|
DeletedObject: dobj,
|
||||||
Bucket: bucket,
|
Bucket: bucket,
|
||||||
|
@ -749,7 +749,7 @@ func testAPIDeleteMultipleObjectsHandler(obj ObjectLayer, instanceType, bucketNa
|
|||||||
for i := range requestList[0].Objects {
|
for i := range requestList[0].Objects {
|
||||||
var vid string
|
var vid string
|
||||||
if isDirObject(requestList[0].Objects[i].ObjectName) {
|
if isDirObject(requestList[0].Objects[i].ObjectName) {
|
||||||
vid = nullVersionID
|
vid = ""
|
||||||
}
|
}
|
||||||
deletedObjects[i] = DeletedObject{
|
deletedObjects[i] = DeletedObject{
|
||||||
ObjectName: requestList[0].Objects[i].ObjectName,
|
ObjectName: requestList[0].Objects[i].ObjectName,
|
||||||
@ -766,7 +766,7 @@ func testAPIDeleteMultipleObjectsHandler(obj ObjectLayer, instanceType, bucketNa
|
|||||||
for i := range requestList[1].Objects {
|
for i := range requestList[1].Objects {
|
||||||
var vid string
|
var vid string
|
||||||
if isDirObject(requestList[0].Objects[i].ObjectName) {
|
if isDirObject(requestList[0].Objects[i].ObjectName) {
|
||||||
vid = nullVersionID
|
vid = ""
|
||||||
}
|
}
|
||||||
deletedObjects[i] = DeletedObject{
|
deletedObjects[i] = DeletedObject{
|
||||||
ObjectName: requestList[1].Objects[i].ObjectName,
|
ObjectName: requestList[1].Objects[i].ObjectName,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user