apache / apache/opendal

bug: `invalid uri character` return when list cos objects contains special key

Open
#6,260 4 comments 1 reaction 0 assignees View on GitHub
bug integrations/object_store services/cos
Dominant language
Rust
Stars
5.4k
Forks
825
Avg merge
1d 14m
Merged PRs (30d)
127

Description

### Describe the bug

When list some path contains chinese chars, operator list operation will return `invalid uri character`

### Steps to Reproduce

```rust
.... // construct Operator blob
let blob= Cos::default()
.root(root)
.bucket(bucket)
.endpoint(endpoint)
.secret_id(access_key)
.secret_key(secret_key);
const SPECIAL_KEY: &str = "测试编码文件aaaaaa.jpg";

let br = Buffer::from("1");
blob.write(SPECIAL_KEY, br).await?;
blob.list("测试编码文件").await?;
```

### Expected Behavior

should return normally without error

### Additional Context

_No response_

### Are you willing to submit a PR to fix this bug?

- [ ] Yes, I would like to submit a PR.

Contributor guide

Open the contributing guide

Research direction

Start with the COS implementation and the path handling used by `blob.list("测试编码文件")`, then run the provided Rust reproduction with the special key `测试编码文件aaaaaa.jpg`. Verify that listing a path containing Chinese characters returns normally without an `invalid uri character` error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.