Skip to content

S3 PutObjectRequest doesn't detect .gz files and set content-type #899

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

Closed
leccelecce opened this issue Dec 4, 2018 · 1 comment
Closed
Labels
investigating This issue is being investigated and/or work is in progress to resolve the issue.

Comments

@leccelecce
Copy link

Expected Behavior

In the V1 SDK, PutObjectRequest would set the content-type to application/x-gzip if I uploaded a .gz file.

Current Behavior

In V2, it sets to the default application/octet-stream

Possible Solution

It looks like this was more broadly looked at in #442 and a mime.types file was created, but this has no mapping for gz

Steps to Reproduce (for bugs)

client.putObject(PutObjectRequest.builder().bucket(awsBucketName).key(key).build(), RequestBody.fromFile(localFile));

(in the above instance, localFile is a Path to a file ending in .gz)

Your Environment

  • AWS Java SDK version used: 2.1.0
  • JDK version used: OpenJDK 11.0.1
  • Operating System and version: Docker: openjdk:11-jre-slim
@varunnvs92 varunnvs92 added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Dec 4, 2018
@varunnvs92
Copy link
Contributor

As per iana official list, the content-type would be application/gzip. It differs from v1. I made a put call and it works fine. Do you have any issues with it?

aws-sdk-java-automation added a commit that referenced this issue Jul 9, 2020
…d5e9232b

Pull request: release <- staging/eaca728f-2dab-47fb-b1fd-7da8d5e9232b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating This issue is being investigated and/or work is in progress to resolve the issue.
Projects
None yet
Development

No branches or pull requests

2 participants