bidord opened a new pull request, #770:
URL: https://github.com/apache/arrow-rs-object-store/pull/770
# Which issue does this PR close?
Closes #769
# Rationale for this change
Cloud-backed stores (AWS, Azure, GCP) return ETags as quoted-strings (e.g.
`"abc123"`) and expect `If-Match`/`If-None-Match` values in that same form, as
required by [RFC 9110
§8.8.3](https://datatracker.ietf.org/doc/html/rfc9110#section-8.8.3) and [§13
(Preconditions)](https://datatracker.ietf.org/doc/html/rfc9110#name-preconditions).
`InMemory` and `LocalFileSystem`, by contrast, were producing bare tokens,
making them inconsistent with the cloud backends and harder to use as drop-in
replacements.
RFC 9110 is already the reference linked from `ObjectMeta::e_tag`,
`GetOptions::if_match`, and `GetOptions::if_none_match` in this crate's
[docs](https://docs.rs/object_store/latest/object_store/struct.GetOptions.html),
where examples already use the quoted form.
# What changes are included in this PR?
- `src/local.rs`: wrap `get_etag` output in double quotes
- `src/memory.rs`: wrap all ETag values produced by `InMemory` /
`InMemoryUpload` in double quotes
- `src/lib.rs`: update precondition tests to use properly quoted ETags
# Are there any user-facing changes?
`InMemory` and `LocalFileSystem` now return ETags in the form `"<value>"`
instead of `<value>`. Other backends are unaffected.
Code that treats ETags as opaque strings and passes them back via `if_match`
or `if_none_match` as-is will not be impacted.
However, code that expected the implementation-specific unquoted ETag format
from one of these two backends might be impacted.
--
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]