aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/s3api_object_handlers_delete.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2024-05-07 08:46:19 -0700
committerchrislu <chris.lu@gmail.com>2024-05-07 08:46:19 -0700
commit1917f70f78b0fa3fba7c3fe5d1feeef3d0b50b33 (patch)
treec95db69153ac6d8e866d3452d3819f2b2a735b8d /weed/s3api/s3api_object_handlers_delete.go
parent96c48bd0daf9403b2943cd4675d9120283b55603 (diff)
downloadseaweedfs-1917f70f78b0fa3fba7c3fe5d1feeef3d0b50b33.tar.xz
seaweedfs-1917f70f78b0fa3fba7c3fe5d1feeef3d0b50b33.zip
also delete parent folder if empty
fix https://github.com/seaweedfs/seaweedfs/issues/5567
Diffstat (limited to 'weed/s3api/s3api_object_handlers_delete.go')
-rw-r--r--weed/s3api/s3api_object_handlers_delete.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/weed/s3api/s3api_object_handlers_delete.go b/weed/s3api/s3api_object_handlers_delete.go
index 197522d0c..580578593 100644
--- a/weed/s3api/s3api_object_handlers_delete.go
+++ b/weed/s3api/s3api_object_handlers_delete.go
@@ -44,7 +44,7 @@ func (s3a *S3ApiServer) DeleteObjectHandler(w http.ResponseWriter, r *http.Reque
directoriesWithDeletion := make(map[string]int)
lastSeparator := strings.LastIndex(object, "/")
if lastSeparator > 0 {
- parentDirectoryPath := fmt.Sprintf("%s/%s", s3a.option.BucketsPath, bucket)
+ parentDirectoryPath := fmt.Sprintf("%s/%s%s", s3a.option.BucketsPath, bucket, object[:lastSeparator])
directoriesWithDeletion[parentDirectoryPath]++
// purge empty folders, only checking folders with deletions