Sha256: 4fad471f5b5213d9f275d66dc94863906806acdcdc78e900a247065b4aaaa008

Contents?: true

Size: 624 Bytes

Versions: 37

Compression:

Stored size: 624 Bytes

Contents

# frozen_string_literal: true

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

37 entries across 37 versions & 1 rubygems

Version Path
aws-sdk-core-3.121.1 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.121.0 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.120.0 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.119.1 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.119.0 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.118.0 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.117.0 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.116.0 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.115.0 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.114.3 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.114.2 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.114.1 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.114.0 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.113.1 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.113.0 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.112.1 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.112.0 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.111.2 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.111.1 lib/seahorse/client/plugins/content_length.rb
aws-sdk-core-3.111.0 lib/seahorse/client/plugins/content_length.rb