mirror of
https://github.com/minio/mc.git
synced 2025-07-28 20:01:58 +03:00
rm: Force removing an object when it is encrypted without key specified (#2700)
Currently, a single remove HEAD an object, but this latter can return 400 Bad Request when the object is encrypted and the user doesn't specify any encryption key. So when HEAD fail, this PR will use GET listing to find the object and remove it if existent. We can avoid calling HEAD in the first place and use only listing, but this has some penality on the server.
This commit is contained in:
@ -96,6 +96,13 @@ var errInvalidTarget = func(URL string) *probe.Error {
|
||||
return probe.NewError(invalidTargetErr(errors.New(msg))).Untrace()
|
||||
}
|
||||
|
||||
type targetNotFoundErr error
|
||||
|
||||
var errTargetNotFound = func(URL string) *probe.Error {
|
||||
msg := "Target `" + URL + "` not found."
|
||||
return probe.NewError(targetNotFoundErr(errors.New(msg))).Untrace()
|
||||
}
|
||||
|
||||
type overwriteNotAllowedErr struct {
|
||||
error
|
||||
}
|
||||
|
Reference in New Issue
Block a user