Skip to content

Fix for Issue #3569 where the user set Content-Encoding was over writ… #3720

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

Merged
merged 1 commit into from
Jan 26, 2023

Conversation

joviegas
Copy link
Contributor

Motivation and Context

Fix for Issue 3569

Modifications

Checksum related interceptors and signers did a putHeader which over wrote the content-encoding header instead of overwriting it, Thus appendHeader is used in these places.

-DefaultAwsCrtS3V4aSigner

  • AbstractAwsS3V4Signer
  • AsyncRequestBodyHttpChecksumTrailerInterceptor
  • SyncHttpChecksumInTrailerInterceptor

Fix

Amazon S3 supports multiple content encodings. For example:
Content-Encoding : aws-chunked,gzip
That is, you can specify your custom content-encoding when using Signature Version 4 streaming API.

Testing

  • Added Junits
  • Aded integ test

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

License

  • I confirm that this pull request can be released under the Apache 2 license

@joviegas joviegas requested a review from a team as a code owner January 26, 2023 01:17
…ten to aws-chunked with Checksum algorithm enabled
@joviegas joviegas force-pushed the joviegas/checksum_content_encoding branch from b9293ac to b8b4ee0 Compare January 26, 2023 01:22
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

88.9% 88.9% Coverage
0.0% 0.0% Duplication

@L-Applin
Copy link
Contributor

Code looks good, but there are some things I'm confused about. Is this quote from the issue still correct?

Expected Behavior
Content-Encoding header should remain unset when using ChecksumAlgorithm.

Because, maybe Im not understanding correctly, it seems we are fixing an issue that overwrites the Content-Encoding, but does not address the fact that it has an empty value? Does the Header needs to be unset or have the aws-chunked value.

@joviegas
Copy link
Contributor Author

joviegas commented Jan 26, 2023

Code looks good, but there are some things I'm confused about. Is this quote from the issue still correct?

Expected Behavior
Content-Encoding header should remain unset when using ChecksumAlgorithm.

Because, maybe Im not understanding correctly, it seems we are fixing an issue that overwrites the Content-Encoding, but does not address the fact that it has an empty value? Does the Header needs to be unset or have the aws-chunked value.

The user is trying to say AWS-sdk-java should not overwrite(reset) the User set Cheunked endcoding value. The unset more of means "over write" here.
With the fix we will be appending the "aws-chunked" header and not reset/overwrite while sending the User set value to S3

, it seems we are fixing an issue that overwrites the Content-Encoding, but does not address the fact that it has an empty value?

Yeap , with the current fix we are not addressing what user sends in Content-Encoding , we are just appending to the header since as part of Checksums for trailers we just need to specific "aws-chunked" and not modify user sent valid/invalid entries for Content-Encoding

Does the Header needs to be unset or have the aws-chunked value.

Nope , we donot need to do any operation on User value just Append aws-chunked to any existing value

@joviegas joviegas enabled auto-merge (squash) January 26, 2023 18:45
@joviegas joviegas requested a review from L-Applin January 26, 2023 18:46
@joviegas joviegas merged commit 303a375 into master Jan 26, 2023
@joviegas joviegas deleted the joviegas/checksum_content_encoding branch May 15, 2024 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants