Skip to content

fix: quote ETags per RFC 9110 in InMemory and LocalFileSystem#770

Open
bidord wants to merge 1 commit into
apache:mainfrom
bidord:fix/etag-rfc9110-quoting
Open

fix: quote ETags per RFC 9110 in InMemory and LocalFileSystem#770
bidord wants to merge 1 commit into
apache:mainfrom
bidord:fix/etag-rfc9110-quoting

Conversation

@bidord

@bidord bidord commented Jun 19, 2026

Copy link
Copy Markdown

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 and §13 (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, 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.

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.

`InMemory` and `LocalFileSystem`, by contrast, were producing bare
tokens, making them inconsistent with the cloud backends and harder to
use as drop-in replacements.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InMemory and LocalFileSystem return unquoted ETags, violating RFC 9110

2 participants