From a57834196c67d76a0c5245588c4c5cfcaa923e85 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 10 Feb 2026 16:11:28 -0800 Subject: [PATCH] Keep explicit directory markers non-implicit --- weed/s3api/s3api_object_handlers_put.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/weed/s3api/s3api_object_handlers_put.go b/weed/s3api/s3api_object_handlers_put.go index f45b09cc2..c5014864b 100644 --- a/weed/s3api/s3api_object_handlers_put.go +++ b/weed/s3api/s3api_object_handlers_put.go @@ -148,13 +148,9 @@ func (s3a *S3ApiServer) PutObjectHandler(w http.ResponseWriter, r *http.Request) if r.ContentLength > 0 { entry.Content, _ = io.ReadAll(r.Body) } + // Explicitly PUT-created directory markers stay explicit. + // Only auto-created parent directories are tagged as implicit. entry.Attributes.Mime = objectContentType - if entry.Extended == nil { - entry.Extended = make(map[string][]byte, 1) - } - // Treat directory-marker PUT entries as implicit so async cleanup can prune - // them when all children are deleted. - entry.Extended[s3_constants.ExtS3ImplicitDir] = []byte("true") // Set object owner for directory objects (same as regular objects) s3a.setObjectOwnerFromRequest(r, bucket, entry)