-
Notifications
You must be signed in to change notification settings - Fork 920
Support trailers in chunked publisher #6264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This commit adds support adding the `trailer-part` of the chunked encoded format.
trailerData = Collections.emptyList(); | ||
} | ||
|
||
int trailerLen = trailerData.stream().mapToInt(t -> t.remaining() + 2).sum(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why +2 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each trailer ends with \r\n
. I'll add a comment
...are/amazon/awssdk/http/auth/aws/internal/signer/chunkedencoding/ChunkedEncodedPublisher.java
Show resolved
Hide resolved
...are/amazon/awssdk/http/auth/aws/internal/signer/chunkedencoding/ChunkedEncodedPublisher.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements support for HTTP trailer headers in the chunked encoding publisher, following the RFC 7230 specification. The chunked encoding format now includes the trailer-part section that allows appending additional headers after the chunked data.
- Adds trailer provider functionality to append headers to the end of chunked streams
- Implements proper formatting of trailer headers with support for multiple values
- Ensures trailers are only added to the final empty chunk (chunk size 0)
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
ChunkedEncodedPublisher.java | Core implementation of trailer support including provider management and proper formatting |
ChunkedEncodedPublisherTest.java | Comprehensive test coverage for trailer functionality including edge cases and validation |
...are/amazon/awssdk/http/auth/aws/internal/signer/chunkedencoding/ChunkedEncodedPublisher.java
Outdated
Show resolved
Hide resolved
...are/amazon/awssdk/http/auth/aws/internal/signer/chunkedencoding/ChunkedEncodedPublisher.java
Show resolved
Hide resolved
...amazon/awssdk/http/auth/aws/internal/signer/chunkedencoding/ChunkedEncodedPublisherTest.java
Show resolved
Hide resolved
...amazon/awssdk/http/auth/aws/internal/signer/chunkedencoding/ChunkedEncodedPublisherTest.java
Show resolved
Hide resolved
|
This commit adds support adding the
trailer-part
of the chunked encoded format.Motivation and Context
Modifications
Testing
Screenshots (if appropriate)
Types of changes
Checklist
mvn install
succeedsscripts/new-change
script and following the instructions. Commit the new file created by the script in.changes/next-release
with your changes.License