You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting a compressed object from S3 with S3Client.getObject when using the default OkHttp engine returns the body uncompressed instead of in its original, persisted form. This is because OkHttp automatically accepts and decompresses GZipped responses. This behavior is surprising and differs from CRT engine and the Java v2 SDK, both of which return the compressed object body.
Expected Behavior
Users are not surprised by unexpectedly decompressed objects.
disable the OkHttp transparent decompression altogether
Context
Currently available workarounds include setting responseContentEncoding = "identity" in the GetObjectRequest, adding an interceptor to accomplish the same thing, or using the CRT engine.
Your Environment
Smithy Kotlin version used: 1.0.15
Platform (JVM/JS/Native): OpenJDK 8
Operating System and version: Amazon Linux 2
The text was updated successfully, but these errors were encountered:
After discussing this we consider this behavior incongruent with other HTTP engines and other AWS SDKs. Our best fix will be to disable transparent decompression altogether, likely by manually setting Accept-Encoding: identity when we construct the OkHttp request object.
Describe the bug
Getting a compressed object from S3 with
S3Client.getObject
when using the default OkHttp engine returns the body uncompressed instead of in its original, persisted form. This is because OkHttp automatically accepts and decompresses GZipped responses. This behavior is surprising and differs from CRT engine and the Java v2 SDK, both of which return the compressed object body.Expected Behavior
Users are not surprised by unexpectedly decompressed objects.
Steps to Reproduce
This code shows the issue:
Possible Solution
We should either:
Context
Currently available workarounds include setting
responseContentEncoding = "identity"
in theGetObjectRequest
, adding an interceptor to accomplish the same thing, or using the CRT engine.Your Environment
The text was updated successfully, but these errors were encountered: