Skip to content

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

Closed
@leccelecce

Description

@leccelecce

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    investigatingThis issue is being investigated and/or work is in progress to resolve the issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions