Sha256: 05b133562feac1ee20b57750295087ed95f7ddc28dd8821176a1e85ba0541fca

Contents?: true

Size: 765 Bytes

Versions: 5

Compression:

Stored size: 765 Bytes

Contents

# frozen_string_literal: true

module Aws
  module NimbleStudio
    module Plugins
      class ContentType < Seahorse::Client::Plugin

        def add_handlers(handlers, _config)
          handlers.add(Handler)
        end

        class Handler < Seahorse::Client::Handler
          def call(context)
            # Some operations break when given an empty content-type header.
            # The SDK adds this blank content-type header
            # since Net::HTTP provides a default that can break services.
            # We're setting one here even though it's not used or necessary.
            context.http_request.headers['content-type'] = 'application/x-amz-json-1.1'
            @handler.call(context)
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
aws-sdk-nimblestudio-1.5.0 lib/aws-sdk-nimblestudio/plugins/content_type.rb
aws-sdk-nimblestudio-1.4.0 lib/aws-sdk-nimblestudio/plugins/content_type.rb
aws-sdk-nimblestudio-1.3.0 lib/aws-sdk-nimblestudio/plugins/content_type.rb
aws-sdk-nimblestudio-1.2.0 lib/aws-sdk-nimblestudio/plugins/content_type.rb
aws-sdk-nimblestudio-1.1.0 lib/aws-sdk-nimblestudio/plugins/content_type.rb