Sha256: 5b7e85b7b9298922a69b4164411889a9ca509378f81ab94f5dc4be38801f1443

Contents?: true

Size: 593 Bytes

Versions: 18

Compression:

Stored size: 593 Bytes

Contents

module Seahorse
  module Client
    module Plugins
      class ContentLength < Plugin

        # @api private
        class Handler < Client::Handler

          def call(context)
            # If it's an IO object and not a File / String / String IO
            if context.http_request.body.respond_to?(:size)
              length = context.http_request.body.size
              context.http_request.headers['Content-Length'] = length
            end
            @handler.call(context)
          end

        end

        handler(Handler, step: :sign, priority: 0)

      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
aws-sdk-core-3.100.0 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.99.2 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.99.1 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.99.0 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.98.0 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.97.1 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.97.0 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.96.1 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.96.0 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.95.0 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.94.1 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.94.0 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.93.0 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.92.0 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.91.1 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.91.0 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.90.1 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.90.0 lib/seahorse/client/plugins/content_length.rb