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

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

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.

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.



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/aws-sdk-core/plugins/checksum_algorithm.rb', line 118

def call(context)
  if should_calculate_request_checksum?(context)
    request_algorithm_input = ChecksumAlgorithm.request_algorithm_selection(context) ||
                              context[:default_request_checksum_algorithm]
    context[:checksum_algorithms] = request_algorithm_input

    request_checksum_property = {
      'algorithm' => request_algorithm_input,
      'in' => checksum_request_in(context),
      'name' => "x-amz-checksum-#{request_algorithm_input.downcase}"
    }

    calculate_request_checksum(context, request_checksum_property)
  end

  if should_verify_response_checksum?(context)
    add_verify_response_checksum_handlers(context)
  end

  @handler.call(context)
end