Skip to content
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

S3 client unable to specify ContentType for PutObject #142

Open
lilhinx opened this issue Jul 18, 2023 · 0 comments
Open

S3 client unable to specify ContentType for PutObject #142

lilhinx opened this issue Jul 18, 2023 · 0 comments

Comments

@lilhinx
Copy link

lilhinx commented Jul 18, 2023

Using this code:

let putRequest:PutObjectRequest = .init( body:objectData, bucket:"bucket-name", contentType:"image/jpeg", key:objectKey )

I get a SignatureDoesNotMatch error.

Using this code where I omit the contentType parameter:
let putRequest:PutObjectRequest = .init( body:objectData, bucket:"bucket-name", key:objectKey )

The request succeeds, but the object put into the bucket as a ContentType of application/x-amz-rest-xml

I looked into the underlying code, and I suspect this is due to the Smoke HTTP client adding a header for both the content type supplied by the caller, and the one added by the framework, which seems invalid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant