Browse Source

Keep explicit directory markers non-implicit

pull/8292/head
Chris Lu 11 hours ago
parent
commit
a57834196c
  1. 8
      weed/s3api/s3api_object_handlers_put.go

8
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)

Loading…
Cancel
Save