diff --git a/Cargo.lock b/Cargo.lock index 9e182b2..cc1f5e5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2217,7 +2217,7 @@ dependencies = [ [[package]] name = "redacter" -version = "0.3.0" +version = "0.3.1" dependencies = [ "async-recursion", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 2961791..969df3e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "redacter" -version = "0.3.0" +version = "0.3.1" edition = "2021" authors = ["Abdulla Abdurakhmanov "] license = "Apache-2.0" diff --git a/src/filesystems/aws_s3.rs b/src/filesystems/aws_s3.rs index 63efa4a..3ff1fe0 100644 --- a/src/filesystems/aws_s3.rs +++ b/src/filesystems/aws_s3.rs @@ -230,9 +230,14 @@ impl<'a> FileSystemConnection<'a> for AwsS3FileSystem<'a> { fn resolve(&self, file_ref: Option<&FileSystemRef>) -> AbsoluteFilePath { AbsoluteFilePath { file_path: if self.is_dir { + let object_name_prefix = if self.object_name == "/" { + "" + } else { + self.object_name.as_str() + }; format!( "{}{}", - &self.object_name, + object_name_prefix, file_ref .map(|fr| fr.relative_path.value().clone()) .unwrap_or_default() diff --git a/src/filesystems/gcs.rs b/src/filesystems/gcs.rs index 5afe82c..bff6f17 100644 --- a/src/filesystems/gcs.rs +++ b/src/filesystems/gcs.rs @@ -233,9 +233,14 @@ impl<'a> FileSystemConnection<'a> for GoogleCloudStorageFileSystem<'a> { fn resolve(&self, file_ref: Option<&FileSystemRef>) -> AbsoluteFilePath { AbsoluteFilePath { file_path: if self.is_dir { + let object_name_prefix = if self.object_name == "/" { + "" + } else { + self.object_name.as_str() + }; format!( "{}{}", - &self.object_name, + object_name_prefix, file_ref .map(|fr| fr.relative_path.value().clone()) .unwrap_or_default()