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.
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