Sha256: e378557521ceea78c85c594eb004058e6ed6b37175ed99ef6611995dbc2d7a8f

Contents?: true

Size: 767 Bytes

Versions: 7

Compression:

Stored size: 767 Bytes

Contents

# frozen_string_literal: true

module Aws
  module LookoutMetrics
    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

7 entries across 7 versions & 1 rubygems

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