Xuanwo opened a new pull request, #8815:
URL: https://github.com/apache/opendal/pull/8815
# Which issue does this PR close?
None.
# Rationale for this change
`OpendalStore::head`, `OpendalStore::get`, `OpendalStore::get_opts`, and
`OpendalStore::format_get_error` constructed `ObjectMeta` by passing
`location.as_ref()` to `format_object_meta(impl Into<Path>, &Metadata)`.
Because `object_store::path::Path::as_ref()` returns the already
percent-encoded raw representation (for example, `"a%23b.txt"` for
`Path::from("a#b.txt")`), converting that `&str` via `Into<Path>` invoked
`Path::from(&str)` and percent-encoded each segment a second time
(`"a%2523b.txt"`). As a result, `ObjectMeta.location` returned from `head`,
`get`, and `get_opts` did not match the input `Path` or the locations returned
by `list*`, and could not be round-tripped back into subsequent `head`, `get`,
or `delete` calls.
# What changes are included in this PR?
- Pass `location.clone()` (an existing `object_store::path::Path`) instead
of `location.as_ref()` to `format_object_meta` in
`OpendalStore::format_get_error`, `OpendalStore::get_opts_without_stat`, and
`OpendalStore::get_opts_with_stat`.
- Add unit tests in `integrations/object_store/src/store.rs` covering paths
containing `#`, `%`, `?`, and non-ASCII characters across `head`, `get`,
`get_opts`, `list`, `list_with_offset`, `list_with_delimiter`, and
round-tripping returned `ObjectMeta.location` values into `head`, `get`, and
`delete`.
# Are there any user-facing changes?
`OpendalStore::head`, `OpendalStore::get`, and `OpendalStore::get_opts` now
return `ObjectMeta.location` matching the input `object_store::path::Path`
without double percent-encoding.
# Breaking changes
# AI Usage Statement
- Harness: pi
- Model: Gemini 4 Neon
- Effort: high
- Role: Implemented the `format_object_meta` call-site fixes in
`integrations/object_store/src/store.rs`, added regression tests covering
special-character paths, and opened this pull request.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]