Skip to content

Commit

Permalink
Actually revert sqs config change
Browse files Browse the repository at this point in the history
  • Loading branch information
mullermp committed Apr 29, 2024
1 parent 4cf966c commit 90edece
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
15 changes: 2 additions & 13 deletions gems/aws-sdk-s3/lib/aws-sdk-s3/plugins/md5s.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,15 @@ def update_in_chunks(digest, io)
end

option(:compute_checksums,
default: true,
doc_type: 'Boolean',
docstring: <<-DOCS
docstring: <<-DOCS)
When `true` a MD5 checksum will be computed and sent in the Content Md5
header for :put_object and :upload_part. When `false`, MD5 checksums
will not be computed for these operations. Checksums are still computed
for operations requiring them. Checksum errors returned by Amazon S3 are
automatically retried up to `:retry_limit` times.
DOCS
) do |config|
# By default, we will disable checksum verification when response
# stubbing is enable. If a user decides to enable both features,
# then they will need to stub the MD5s in the response.
# See the spec/aws/sqs/client/verify_checksums_spec.rb for
# examples of how to do this.
if config.respond_to?(:stub_responses)
!config.stub_responses
else
config.verify_checksums
end
end

def add_handlers(handlers, config)
if config.compute_checksums
Expand Down
14 changes: 12 additions & 2 deletions gems/aws-sdk-sqs/lib/aws-sdk-sqs/plugins/md5s.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,25 @@ def mismatch_error_message(section, local_md5, returned_md5, response)

option(:verify_checksums,
doc_default: true,
default: true,
doc_type: 'Boolean',
docstring: <<-DOCS
When `true` MD5 checksums will be computed for messages sent to
an SQS queue and matched against MD5 checksums returned by Amazon SQS.
`Aws::Errors::Checksum` errors are raised for cases where checksums do
not match.
DOCS
)
) do |config|
# By default, we will disable checksum verification when response
# stubbing is enable. If a user decides to enable both features,
# then they will need to stub the MD5s in the response.
# See the spec/aws/sqs/client/verify_checksums_spec.rb for
# examples of how to do this.
if config.respond_to?(:stub_responses)
!config.stub_responses
else
config.verify_checksums
end
end

def add_handlers(handlers, config)
if config.verify_checksums
Expand Down

0 comments on commit 90edece

Please sign in to comment.