fix(app): inflate gzip-compressed request bodies - #1513
Open
Lukasdoe wants to merge 1 commit into
Open
Conversation
|
Docker image for this PR has been published: |
Collaborator
|
@Lukasdoe Do you have a repro script for this? I don't have any source to back this PR |
Lukasdoe
force-pushed
the
fix/gzip-request-body
branch
from
August 26, 2026 13:22
0b1b18e to
a48e2b2
Compare
|
Docker image for this PR has been published: |
Smithy's @requestCompression trait makes an AWS SDK gzip a request body once it passes REQUEST_MIN_COMPRESSION_SIZE_BYTES (default 10240) and send Content-Encoding: gzip. CloudWatch PutMetricData carries the trait in botocore's and aws-sdk-go-v2's bundled models, so boto3 compresses it with no client configuration at all. The aws-chunked decoder strips the chunk framing but leaves the gzip layer, so the handler parses compressed bytes. A PutMetricData call above 10 KB answered 200 and stored none of the batch: the caller lost every datapoint with no error to see. Inflate the body once the target service is known and drop the gzip token from Content-Encoding. S3 is excluded: Content-Encoding is object metadata there, so the stored bytes must stay exactly as sent, which the existing S3 encoding test pins. Tests cover the operation an SDK really compresses (boto3 PutMetricData, asserting the request was gzipped so the test cannot silently stop covering the bug), the JSON and Query wire paths with hand-built gzip bodies, and an S3 passthrough guard.
Lukasdoe
force-pushed
the
fix/gzip-request-body
branch
from
August 26, 2026 13:30
a48e2b2 to
ea728c4
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.
AWS SDKs gzip request bodies above ~10 KB for operations carrying smithy's @requestCompression trait (Lambda CreateFunction, CloudWatch Logs, EC2) and send Content-Encoding: gzip. The aws-chunked decoder strips the chunk framing but leaves the gzip layer, so handlers parse compressed bytes and fail with SerializationException (Lambda, Logs) or InvalidAction (EC2, where the gzipped form body hides the Action parameter).
Inflate the body once the target service is known and drop the gzip token from Content-Encoding. S3 is excluded: Content-Encoding is object metadata there, so the stored bytes must stay exactly as sent.