Return if paths are empty in DeleteFileBulk (#8085)

This avoids a network call, also fixes an issue
when empty paths are passed the underlying call
fails with "405 Method Not Allowed".

This is reproducible when you are deleting a
non-existent object.

Fixes #8083
master
Harshavardhana 5 years ago committed by GitHub
parent 825e29f301
commit 6e7962bf35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      cmd/storage-rest-client.go

@ -374,6 +374,9 @@ func (client *storageRESTClient) DeleteFile(volume, path string) error {
// DeleteFileBulk - deletes files in bulk.
func (client *storageRESTClient) DeleteFileBulk(volume string, paths []string) (errs []error, err error) {
if len(paths) == 0 {
return errs, err
}
errs = make([]error, len(paths))
values := make(url.Values)
values.Set(storageRESTVolume, volume)

Loading…
Cancel
Save