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

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

commit 881acb060e785827ae3e364bdb3e889a1b32f288
Author: Xuanwo <[email protected]>
AuthorDate: Tue Apr 18 19:22:48 2023 +0800

    fix(services/s3): Ignore empty query to make it more compatible
    
    Signed-off-by: Xuanwo <[email protected]>
---
 core/src/services/s3/core.rs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/core/src/services/s3/core.rs b/core/src/services/s3/core.rs
index 6844212a..b9f2281a 100644
--- a/core/src/services/s3/core.rs
+++ b/core/src/services/s3/core.rs
@@ -438,10 +438,13 @@ impl S3Core {
         let p = build_abs_path(&self.root, path);
 
         let mut url = format!(
-            "{}?list-type=2&delimiter={delimiter}&prefix={}",
+            "{}?list-type=2&prefix={}",
             self.endpoint,
             percent_encode_path(&p)
         );
+        if !delimiter.is_empty() {
+            write!(url, "&delimiter={delimiter}").expect("write into string 
must succeed");
+        }
         if let Some(limit) = limit {
             write!(url, "&max-keys={limit}").expect("write into string must 
succeed");
         }

Reply via email to