mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-07 20:47:46 +01:00
s3: list the size of a directory marker that has a body (#11830)
This commit is contained in:
1 parent
e7923c14d1
commit
4e5fed9e9e
2 files changed
+22
-1
No files matched your search
@@ -688,11 +688,16 @@ func newListEntry(s3a *S3ApiServer, entry *filer_pb.Entry, key string, dir strin
|
||||
// Determine ETag: prioritize ExtETagKey for versioned objects (supports multipart ETags),
|
||||
// then fall back to filer.ETag() which uses Md5 attribute or calculates from chunks
|
||||
etag := s3a.getObjectETag(entry)
|
||||
size := int64(filer.FileSize(entry))
|
||||
if isDirectory && size == 0 {
|
||||
// A trailing-slash key keeps its body inline in the directory entry, with no FileSize.
|
||||
size = int64(len(entry.Content))
|
||||
}
|
||||
listEntry = ListEntry{
|
||||
Key: key,
|
||||
LastModified: time.Unix(entry.Attributes.Mtime, 0).UTC(),
|
||||
ETag: etag,
|
||||
Size: int64(filer.FileSize(entry)),
|
||||
Size: size,
|
||||
StorageClass: StorageClass(storageClass),
|
||||
}
|
||||
if fetchOwner {
|
||||
|
||||
Reference in new issue
Block a user