|
|
@ -281,7 +281,7 @@ func setPutObjHeaders(w http.ResponseWriter, objInfo ObjectInfo, delete bool) { |
|
|
|
// deleteObject is a convenient wrapper to delete an object, this
|
|
|
|
// deleteObject is a convenient wrapper to delete an object, this
|
|
|
|
// is a common function to be called from object handlers and
|
|
|
|
// is a common function to be called from object handlers and
|
|
|
|
// web handlers.
|
|
|
|
// web handlers.
|
|
|
|
func deleteObject(ctx context.Context, obj ObjectLayer, cache CacheObjectLayer, bucket, object string, r *http.Request, opts ObjectOptions) (objInfo ObjectInfo, err error) { |
|
|
|
func deleteObject(ctx context.Context, obj ObjectLayer, cache CacheObjectLayer, bucket, object string, w http.ResponseWriter, r *http.Request, opts ObjectOptions) (objInfo ObjectInfo, err error) { |
|
|
|
deleteObject := obj.DeleteObject |
|
|
|
deleteObject := obj.DeleteObject |
|
|
|
if cache != nil { |
|
|
|
if cache != nil { |
|
|
|
deleteObject = cache.DeleteObject |
|
|
|
deleteObject = cache.DeleteObject |
|
|
@ -293,22 +293,24 @@ func deleteObject(ctx context.Context, obj ObjectLayer, cache CacheObjectLayer, |
|
|
|
if objInfo.DeleteMarker { |
|
|
|
if objInfo.DeleteMarker { |
|
|
|
// Notify object deleted marker event.
|
|
|
|
// Notify object deleted marker event.
|
|
|
|
sendEvent(eventArgs{ |
|
|
|
sendEvent(eventArgs{ |
|
|
|
EventName: event.ObjectRemovedDeleteMarkerCreated, |
|
|
|
EventName: event.ObjectRemovedDeleteMarkerCreated, |
|
|
|
BucketName: bucket, |
|
|
|
BucketName: bucket, |
|
|
|
Object: objInfo, |
|
|
|
Object: objInfo, |
|
|
|
ReqParams: extractReqParams(r), |
|
|
|
ReqParams: extractReqParams(r), |
|
|
|
UserAgent: r.UserAgent(), |
|
|
|
RespElements: extractRespElements(w), |
|
|
|
Host: handlers.GetSourceIP(r), |
|
|
|
UserAgent: r.UserAgent(), |
|
|
|
|
|
|
|
Host: handlers.GetSourceIP(r), |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// Notify object deleted event.
|
|
|
|
// Notify object deleted event.
|
|
|
|
sendEvent(eventArgs{ |
|
|
|
sendEvent(eventArgs{ |
|
|
|
EventName: event.ObjectRemovedDelete, |
|
|
|
EventName: event.ObjectRemovedDelete, |
|
|
|
BucketName: bucket, |
|
|
|
BucketName: bucket, |
|
|
|
Object: objInfo, |
|
|
|
Object: objInfo, |
|
|
|
ReqParams: extractReqParams(r), |
|
|
|
ReqParams: extractReqParams(r), |
|
|
|
UserAgent: r.UserAgent(), |
|
|
|
RespElements: extractRespElements(w), |
|
|
|
Host: handlers.GetSourceIP(r), |
|
|
|
UserAgent: r.UserAgent(), |
|
|
|
|
|
|
|
Host: handlers.GetSourceIP(r), |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|