This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch xuanwo/azfile-list-content-length
in repository https://gitbox.apache.org/repos/asf/opendal.git

commit 0a79e2c66b90269efa0c496c831cf81fee96b71c
Author: Xuanwo <[email protected]>
AuthorDate: Mon Feb 23 21:37:32 2026 +0800

    fix(services/azfile): avoid defaulting list size to zero
---
 core/services/azfile/src/lister.rs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/core/services/azfile/src/lister.rs 
b/core/services/azfile/src/lister.rs
index 289db82b9..d5d6ed6d0 100644
--- a/core/services/azfile/src/lister.rs
+++ b/core/services/azfile/src/lister.rs
@@ -74,10 +74,12 @@ impl oio::PageList for AzfileLister {
         }
 
         for file in results.entries.file {
-            let meta = Metadata::new(EntryMode::FILE)
+            let mut meta = Metadata::new(EntryMode::FILE)
                 .with_etag(file.properties.etag)
-                
.with_content_length(file.properties.content_length.unwrap_or(0))
                 
.with_last_modified(Timestamp::parse_rfc2822(&file.properties.last_modified)?);
+            if let Some(size) = file.properties.content_length {
+                meta.set_content_length(size);
+            }
             let path = self.path.clone().trim_start_matches('/').to_string() + 
&file.name;
             ctx.entries.push_back(oio::Entry::new(&path, meta));
         }

Reply via email to