Skip to content

Regression: cannot set S3Object contentEncoding #4725

@youngm

Description

@youngm

Describe the bug

No matter what I set for contentEncoding it is always changed to "aws-chunked"

Expected Behavior

The contentEncoding I provide will be stored with the object.

Current Behavior

the contentEncoding is changed to "aws-chunked"

Reproduction Steps

Here is a test case:

    var putRequest =
        PutObjectRequest.builder()
            .bucket(TEST_BUCKET)
            .key(TEST_FILE)
            .contentEncoding("bogus")
            .build();

    s3Client.putObject(putRequest, RequestBody.fromBytes(TEST_BYTES));
    var response = s3Client.getObject(GetObjectRequest.builder().bucket(TEST_BUCKET).key(TEST_FILE).build());
    assertThat(response.response().contentEncoding()).isEqualTo("bogus");

Possible Solution

This appears to be a regression related to #4653 but I'm not sure. The problem started with version 2.21.16

Additional Information/Context

No response

AWS Java SDK version used

2.21.16

JDK version used

17

Operating System and version

Windows 11

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions