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)