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

xuanwo pushed a commit to branch fix-stat
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git

commit c0af347a1e8a029f4066f584253544955658b495
Author: Xuanwo <[email protected]>
AuthorDate: Wed Nov 22 19:52:17 2023 +0800

    FIx webhdfs
    
    Signed-off-by: Xuanwo <[email protected]>
---
 core/src/services/webhdfs/backend.rs | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/core/src/services/webhdfs/backend.rs 
b/core/src/services/webhdfs/backend.rs
index 9fa9bd150..4a834dc10 100644
--- a/core/src/services/webhdfs/backend.rs
+++ b/core/src/services/webhdfs/backend.rs
@@ -508,6 +508,13 @@ impl Accessor for WebhdfsBackend {
                     .map_err(new_json_deserialize_error)?
                     .file_status;
 
+                if path.ends_with('/') && file_status.ty == 
FileStatusType::File {
+                    return Err(Error::new(
+                        ErrorKind::NotFound,
+                        "given path is not a directory",
+                    ));
+                }
+
                 let meta = match file_status.ty {
                     FileStatusType::Directory => Metadata::new(EntryMode::DIR),
                     FileStatusType::File => Metadata::new(EntryMode::FILE)

Reply via email to