From bed6b3a2111d6c914bbce74d9bceaed69a150a68 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Fri, 23 Feb 2024 13:28:25 +0800 Subject: [PATCH] Fix build Signed-off-by: Xuanwo --- core/src/services/webdav/lister.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/services/webdav/lister.rs b/core/src/services/webdav/lister.rs index 36ce9c8ee86a..fb139434860d 100644 --- a/core/src/services/webdav/lister.rs +++ b/core/src/services/webdav/lister.rs @@ -53,7 +53,11 @@ impl oio::PageList for WebdavLister { let oes = self.multistates.response.clone(); for res in oes { - let path = res.href.trim_start_matches(&self.server_path); + let path = match res.href.strip_suffix(&self.server_path) { + Some(p) => p, + None => &res.href, + }; + let path = if path.is_empty() { "" } else { path }; // Ignore the root path itself. if self.root == path {