-
Notifications
You must be signed in to change notification settings - Fork 853
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
Empty Content-Encoding header with S3 CRT client #5071
Comments
Hi @bertbaron, Thank you for reporting the issue. I am able to reproduce the behaviour which you have highlighted in the issue. Using the code snippet Though I am inclined to relate this problem to the cross-sdk issue aws/aws-sdk#498, in your example I do not see the Will look further to understand why the empty I will check and keep you posted on it. Regards, |
Hi @bertbaron, When I enabled the CRT debug logs, I can see that Java SDK is sending the The cross-SDK issue that I linked earlier aws/aws-sdk#498 is the right place to track it, as it impacts the other SDKs as well. This issue has been reported internally to the S3 team, who has a backlog item to track it further. Therefore, I will go ahead and close this one. We'll post further updates for it on the cross-SDK issue. Regards, |
Thanks for the update, I will track the other issue. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the bug
When performing a PutObjectRequest using S3 CRT client, an empty Content-Encoding header (system-defined metadata) is set to the object.
While this header in itself may not be much of a problem, it completely broke our sites served from CloudFront with the Manged-CachingOptimized behavior. The reason is that, when CloudFront decides to send the content compressed, it adds a header like
Content-Encoding: br
but also includes the emptyContent-Encoding:
header. The result is that the browser may assume the content is uncompressed.Note that this behavior seems to be very similar to this issue from 2017 on the .NET client: aws/aws-sdk-net#559. The issues in combination with CloudFront is also mentioned in a comment there.
Expected Behavior
When performing a PutObjectRequest using S3 CRT client, without explicitly specifying contentEncoding, no
Content-Encoding
header should be setCurrent Behavior
When performing a PutObjectRequest using S3 CRT client, without explicitly specifying contentEncoding, an empty Content-Encoding header is set
Reproduction Steps
To reproduce the following code snippet can be used
Possible Solution
Our current workaround is to not use the CRT client (replacing
S3AsyncClient.crtBuilder()
withS3AsyncClient.builder()
)Additional Information/Context
Version 0.29.11 of aws-crt was used
AWS Java SDK version used
2.25.1
JDK version used
openjdk 21.0.2 2024-01-16 LTS
Operating System and version
any
The text was updated successfully, but these errors were encountered: