Set Content-Length when the request body is set instead of via middleware - #3513
Open
Tongs2000 wants to merge 2 commits into
Open
Set Content-Length when the request body is set instead of via middleware#3513Tongs2000 wants to merge 2 commits into
Tongs2000 wants to merge 2 commits into
Conversation
Tongs2000
marked this pull request as ready for review
August 12, 2026 16:25
Tongs2000
force-pushed
the
feat-inline-content-length
branch
3 times, most recently
from
August 12, 2026 22:19
967b738 to
258b681
Compare
Content-Length is now set when the request body is set via smithy-go Request.SetStream, so the generated stacks no longer register the standalone ComputeContentLength middleware.
Tongs2000
force-pushed
the
feat-inline-content-length
branch
from
August 12, 2026 23:46
258b681 to
e3bba75
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.
Description
Content-Length is now set when the request body is set, via smithy-go
Request.SetStream, so the generated middleware stacks no longer register the standaloneComputeContentLengthmiddleware.The first commit is the codegen change (stop registering the middleware, plus a test fixup). The second commit is the regenerated output, so the large diff in generated files is expected and comes from code generation, not manual edits.
Behavior
SetStreamsets the length when the body is a known length reader such as a bytes or strings reader or a seekable stream. Request compression updates the length after compressing. When the length cannot be determined, for example a non seekable stream,ContentLengthis left unchanged so a user provided value is preserved.Cross repo dependency
This depends on the smithy-go change that makes
Request.SetStreamset Content-Length (aws/smithy-go#694). The SDK needs to be pinned to that released version before merging.No changelog entry is included, per the PR guidelines.