Class: Aws::Plugins::ChecksumAlgorithm::ChecksumHandler Private

Inherits:
Seahorse::Client::Handler show all
Defined in:
lib/aws-sdk-core/plugins/checksum_algorithm.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

API:

  • private

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Handler

#handler

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Handler

#initialize, #inspect

Constructor Details

This class inherits a constructor from Seahorse::Client::Handler

Instance Method Details

#call(context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/aws-sdk-core/plugins/checksum_algorithm.rb', line 181

def call(context)
  algorithm = nil
  if should_calculate_request_checksum?(context)
    algorithm = choose_request_algorithm!(context)
    request_algorithm = {
      algorithm: algorithm,
      in: checksum_request_in(context),
      name: "x-amz-checksum-#{algorithm.downcase}",
      request_algorithm_header: request_algorithm_header(context)
    }
    context[:http_checksum][:request_algorithm] = request_algorithm
    calculate_request_checksum(context, request_algorithm)
  end

  add_verify_response_checksum_handlers(context) if should_verify_response_checksum?(context)

  with_metrics(context.config, algorithm) { @handler.call(context) }
end