You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting in aws-sdk-core 3.192.0, the behavior of presigned_url changed to always add content-type as a signed header even when it is not specified in the params. We don't know ahead of time what type of file will be uploaded, so need to allow anything. I don't even know what content-type is expected, since I didn't specify one in the presigned_url call. This breaks our uploads, and is preventing me from upgrading aws-sdk gems.
Expected Behavior
Prior to 3.192.0, presigned_url(:put, { acl: 'bucket-owner-full-control', server_side_encryption: 'AES256', expires_in: 600 } would return a URL with X-Amz-SignedHeaders=host.
Current Behavior
Starting with 3.192.0, presigned_url(:put, { acl: 'bucket-owner-full-control', server_side_encryption: 'AES256', expires_in: 600 } returns a URL with X-Amz-SignedHeaders=content-type;host.
I've tried setting various values for content_type: in the params hash (nil, '', '*') but none of them remove content-type from the signed headers, or allow arbitrary uploads.
Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version
aws-sdk-core
Environment details (Version of Ruby, OS environment)
Ruby 3.2.2. I'm on an M1 Mac, but this also happens in our docker image which is slim-bookworm.
The text was updated successfully, but these errors were encountered:
Thanks for opening an issue. Are you using the latest aws-sdk-s3? I believe that gem was updated to remove content type for presigned url in this case.
You are absolutely right. Thanks for your help, and sorry for the pointless bug report. I have too many dependabot PRs. I could have sworn I ran my tests in all of them, but obviously I missed the one with the aws-sdk-s3 update, because it works in that one. Thanks!
This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
Describe the bug
Starting in aws-sdk-core 3.192.0, the behavior of
presigned_url
changed to always addcontent-type
as a signed header even when it is not specified in the params. We don't know ahead of time what type of file will be uploaded, so need to allow anything. I don't even know what content-type is expected, since I didn't specify one in thepresigned_url
call. This breaks our uploads, and is preventing me from upgrading aws-sdk gems.Expected Behavior
Prior to 3.192.0,
presigned_url(:put, { acl: 'bucket-owner-full-control', server_side_encryption: 'AES256', expires_in: 600 }
would return a URL withX-Amz-SignedHeaders=host
.Current Behavior
Starting with 3.192.0,
presigned_url(:put, { acl: 'bucket-owner-full-control', server_side_encryption: 'AES256', expires_in: 600 }
returns a URL withX-Amz-SignedHeaders=content-type;host
.Reproduction Steps
presigned_url(:put, { acl: 'bucket-owner-full-control', server_side_encryption: 'AES256', expires_in: 600 }
Possible Solution
No response
Additional Information/Context
I've tried setting various values for
content_type:
in the params hash (nil
,''
,'*'
) but none of them remove content-type from the signed headers, or allow arbitrary uploads.Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version
aws-sdk-core
Environment details (Version of Ruby, OS environment)
Ruby 3.2.2. I'm on an M1 Mac, but this also happens in our docker image which is slim-bookworm.
The text was updated successfully, but these errors were encountered: