fix (s3): mv does not work for nested objects

The mv operation executes CopyObject API on the root object, meanwhile
CopyObject doesn't copy the nested objects.

As a result, the user loses all nested objects and after the move
operation gets an empty bucket that requested to move.

This change disallows possibility of moving nested objects.
This commit is contained in:
Marcin Piwowarczyk
2020-02-20 07:50:52 +01:00
parent f3c4bdb8a8
commit e7bf46eeb5
+1 -1
View File
@@ -275,7 +275,7 @@ func (s S3Backend) Mv(from string, to string) error {
t := s.path(to)
client := s3.New(s.createSession(f.bucket))
if f.path == "" {
if f.path == "" || strings.HasSuffix(from, "/") {
return NewError("Can't move this", 403)
}