This repository was archived by the owner on Mar 23, 2026. It is now read-only.
fix S3 PUT operations returning HTTP Body by default#9036
Merged
Conversation
1 task
alexrashed
approved these changes
Sep 1, 2023
Member
alexrashed
left a comment
There was a problem hiding this comment.
Nice! Really great to see how much indirections can be removed with just handling that one condition on a global level in the serializer! 🚀
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Motivation
As reported in #9032, some S3 operations (the one using the
PUThttp method) would return an empty XML body when the S3 docs specifies that the body should be empty. After looking at the specs, onlyCopyObjectandCopyObjectPartwould return a body. Luckily, those operations implement a field specifying that they return a body, thepayloadone.Changes
Removed the pre-signed handler deleting the response body, since this behaviour should have been for every
PUTrequest except some, and it was actually fixing a symptom instead of the cause.Implemented a check in the serializer for not serializing a body if the conditions were not set (if it's a PUT request without the
payloadfield).Added 2 cases in a test checking the raw returned body without boto parsing, one for a known PUT operation which should return a body (
CopyObject) and one forUploadPart, which should not return a body.