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

Add x-amz-checksum headers on put_object #256

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

crbelaus
Copy link

Pull request #244 added support for x-amz-checksum headers when using other hash algorithms than md5. This pull request adds the relevant header when using put_object so new objects will have the appropriate checksum header.

This will work automatically as long as you have something like this in your configuration:

config :ex_aws_s3, :content_hash_algorithm, :sha256 # or :sha or :md5

Additionally, this pull request also updates the accepted headers for the head_object call so you can get the checksum that was stored in S3 when the object was created. This can be done with the following code:

bucket
|> ExAws.S3.head_object(object, x_amz_checksum_mode: "enabled")
|> ExAws.request!()

@crbelaus crbelaus marked this pull request as draft April 16, 2024 16:36
@bernardd
Copy link
Contributor

bernardd commented Jun 4, 2024

Hi @crbelaus. This looks good, thanks! Is it ready to be merged?

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

Successfully merging this pull request may close these issues.

2 participants