fix: quote ETags per RFC 9110 in InMemory and LocalFileSystem#770
Open
bidord wants to merge 1 commit into
Open
fix: quote ETags per RFC 9110 in InMemory and LocalFileSystem#770bidord wants to merge 1 commit into
bidord wants to merge 1 commit into
Conversation
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.
kylebarron
approved these changes
Jun 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 expectIf-Match/If-None-Matchvalues in that same form, as required by RFC 9110 §8.8.3 and §13 (Preconditions).InMemoryandLocalFileSystem, 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, andGetOptions::if_none_matchin this crate's docs, where examples already use the quoted form.What changes are included in this PR?
src/local.rs: wrapget_etagoutput in double quotessrc/memory.rs: wrap all ETag values produced byInMemory/InMemoryUploadin double quotessrc/lib.rs: update precondition tests to use properly quoted ETagsAre there any user-facing changes?
InMemoryandLocalFileSystemnow 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_matchorif_none_matchas-is will not be impacted.However, code that expected the implementation-specific unquoted ETag format from one of these two backends might be impacted.