-
Notifications
You must be signed in to change notification settings - Fork 28
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
feat: expand use of chunked
content encoding
#1018
Conversation
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.
This change seems ok but I don't think it addresses the underlying issue. If a user submits a request without a flexible checksum this would still fail right? I think we need to solve that because it looks like the request in the issue without a checksum should succeed as well unless I'm missing something.
@@ -163,6 +165,12 @@ public class AwsHttpSigner(private val config: Config) : HttpSigner { | |||
HashSpecification.StreamingAws4HmacSha256Payload | |||
} | |||
} | |||
request.headers["x-amz-checksum-sha256"] != null -> { |
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.
suggestion: Should probably be a constant value somewhere.
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.
fix: Needs tests
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
aws-chunked
content encoding
aws-chunked
content encodingchunked
content encoding
get() = (this is HttpBody.SourceContent || this is HttpBody.ChannelContent) && | ||
(isOneShot || (contentLength?.compareTo(AWS_CHUNKED_THRESHOLD) ?: 0) > 0) |
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.
Style: ?.compareTo
works but is pretty verbose and still requires null-coalescing the value. Shorter would just be:
(contentLength ?: 0 > AWS_CHUNKED_THRESHOLD)
Same comment applies below.
If a streaming body with an undefined content length is provided, upload it with
chunked
to ensure the hash can be properly calculated. This reduces occurrences of exceptions claimingStream must be replayable to calculate a body hash
Issue #
Addresses an issue in awslabs/aws-sdk-kotlin#1157
Description of changes
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.