fix(s3): Add Content-MD5 header for DeleteObjects to fix AWS SDK v3.339.0+ compatibility#60195
Open
fix(s3): Add Content-MD5 header for DeleteObjects to fix AWS SDK v3.339.0+ compatibility#60195
Conversation
f702ac8 to
54efa19
Compare
Member
Author
|
Tested locally on S3, it works. |
54efa19 to
9fb8218
Compare
Member
Author
|
/backport to stable33 please |
Member
Author
|
/backport to stable32 please |
CarlSchwan
approved these changes
May 7, 2026
ba36081 to
c33cdc4
Compare
artonge
reviewed
May 7, 2026
artonge
reviewed
May 7, 2026
artonge
approved these changes
May 7, 2026
…39.0+ compatibility AWS SDK PHP v3.339.0+ introduced a breaking change requiring the Content-MD5 header for DeleteObjects operations. This causes 'MissingContentMD5' errors when using S3-compatible services like MinIO. Add middleware to automatically calculate and inject the Content-MD5 header on all DeleteObjects requests. This is applied universally at the S3ConnectionTrait level, fixing both external storage (AmazonS3) and core ObjectStore (S3) classes. Fixes: aws/aws-sdk-php#3068 Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Co-authored-by: Louis <louis@chmn.me> Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
5ecb17c to
5de4acc
Compare
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.
Issue
AWS SDK PHP v3.339.0+ introduced a breaking change requiring the
Content-MD5header for DeleteObjects operations. This causesMissingContentMD5errors (HTTP 400) when using S3-compatible services like MinIO or when strict compliance is enforced.Related: aws/aws-sdk-php#3068
Solution
Add middleware to the S3Client handler list that automatically calculates and injects the
Content-MD5header on all DeleteObjects requests. This fix:S3ConnectionTraitlevel, covering both external storage (AmazonS3) and core ObjectStore (S3) classesMiddlewareAPI andUtils::hash()for MD5 calculationdelete)Changes
Modified files:
Aws\Middleware,GuzzleHttp\Psr7\UtilsaddDeleteObjectsContentMd5Middleware()private method that appends middleware to calculate and inject the headergetConnection()after S3Client instantiation, before bucket verificationNew test file: