Skip to content

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?

@maartenJacobs
Copy link

Having the hash header in put_object would be great for automatic data integrity checks so if there's no update, I can create a separate PR for that

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.

3 participants