From 5efe24b0c3e11142285c9d29c5415ae875e43d4d Mon Sep 17 00:00:00 2001 From: frankwang <73262844+Frank-III@users.noreply.github.com> Date: Wed, 4 Dec 2024 01:08:38 -0600 Subject: [PATCH] fix(services/unftp): add `/` when not presented (#5382) --- integrations/unftp-sbe/src/lib.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/integrations/unftp-sbe/src/lib.rs b/integrations/unftp-sbe/src/lib.rs index 4f99195461df..415c5bc5e76a 100644 --- a/integrations/unftp-sbe/src/lib.rs +++ b/integrations/unftp-sbe/src/lib.rs @@ -222,10 +222,11 @@ impl StorageBackend for OpendalStorage { } async fn mkd + Send + Debug>(&self, _: &User, path: P) -> storage::Result<()> { - self.op - .create_dir(convert_path(path.as_ref())?) - .await - .map_err(convert_err) + let mut path_str = convert_path(path.as_ref())?.to_string(); + if !path_str.ends_with('/') { + path_str.push('/'); + } + self.op.create_dir(&path_str).await.map_err(convert_err) } async fn rename + Send + Debug>(