Skip to content

Presigner Does Not Support Wildcard for Content-Types #5980

Open
@fine-pine

Description

@fine-pine

Describe the bug

According to RFC 9110, Content-Type should support wildcards.

However, if the Content-Type is application/*, the application/octet-stream header was not accepted and a SignatureDoesNotMatch error occurred.

https://www.rfc-editor.org/rfc/rfc9110.html#name-wildcard-values

Expected Behavior

200 Success

Current Behavior

SignatureDoesNotMatch

Reproduction Steps

PutObjectRequest objectRequest = PutObjectRequest.builder()
        .bucket(BUCKET_NAME)
        .key(generateKeyName("docs/", filename))
        .contentType("application/*")
        .build();

PutObjectPresignRequest presignRequest = PutObjectPresignRequest.builder()
        .signatureDuration(EXPIRE_DURATION)
        .putObjectRequest(objectRequest)
        .build();

return presigner.presignPutObject(presignRequest).url().toExternalForm();

Possible Solution

No response

Additional Information/Context

No response

AWS Java SDK version used

software.amazon.awssdk:s3:2.30.38

JDK version used

java 17.0.11 2024-04-16 LTS

Operating System and version

Windows 11 Education 10.0.26100

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions