Skip to content

Conversation

@AlejandroBlanco
Copy link

Description

This pull request addresses a significant discrepancy in ETag handling between S3Mock and the actual AWS S3 service, particularly concerning conditional headers such as If-Match, If-None-Match anf If-Range. While S3Mock currently adheres strictly to RFC 7232, requiring ETags to be quoted (e.g., "abcde"), AWS S3 exhibits more lenient behavior, accepting unquoted ETags in these headers

The difference leads to 412 PRECONDITION FAILED HTTP errors when http clients, specifically the AWS Java SDK (versions aws-java-sdk-1.12.367.jar and later), send requests to S3Mock with unquoted ETags. To ensure S3Mock functions as a reliable stand-in for AWS S3 during development and testing, this change modifies S3Mock's ETag parsing logic to be more flexible, accommodating both quoted and unquoted ETag formats, thereby mirroring AWS S3's behaviour. This change will prevent unnecessary failures for applications designed to interact with AWS S3.

Related Issue

Fixes #2665

Tasks

  • I have signed the CLA.
  • I have written tests and verified that they fail without my change.

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.

ETag quoting mismatch between AWS S3 and S3Mock when using conditional headers

1 participant