1
0
mirror of https://github.com/minio/mc.git synced 2025-11-12 01:02:26 +03:00

Fix: do not check if object listed equals object being removed (#2748)

List within the statURL function considers object name as a prefix
and lists objects that have the same prefix.
currently, it errors out if the object is a subset of another object.

This PR will fix this.

Fixes #2746
This commit is contained in:
kannappanr
2019-04-16 20:44:57 -07:00
committed by GitHub
parent 5729a01e69
commit 68a9eeae18

View File

@@ -155,7 +155,7 @@ func statURL(targetURL string, isIncomplete, isRecursive bool, encKeyDB map[stri
}
url := targetAlias + getKey(content)
if !isRecursive && url != targetURL {
if !isRecursive && !strings.HasPrefix(url, targetURL) {
return nil, errTargetNotFound(targetURL)
}