Sha256: 3785f41eba570c0b3d3e9a4531ebb335e94a58dec71e20348522cd2b5c762c7e

Contents?: true

Size: 629 Bytes

Versions: 14

Compression:

Stored size: 629 Bytes

Contents

# typed: false
# frozen_string_literal: true

require 'net/http'

module Workato
  module Extension
    module CaseSensitiveHeaders
      module Net
        module HTTPHeader
          attr_accessor :case_sensitive_headers

          def capitalize(modified_name)
            return super if case_sensitive_headers.blank?

            original_name = case_sensitive_headers.keys.find { |name| name.downcase == modified_name }
            original_name.presence || super
          end
        end
      end

      ::Net::HTTPHeader.prepend Net::HTTPHeader
      ::Net::HTTPGenericRequest.prepend Net::HTTPHeader
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
workato-connector-sdk-1.3.13 lib/workato/extension/case_sensitive_headers.rb
workato-connector-sdk-1.3.12 lib/workato/extension/case_sensitive_headers.rb
workato-connector-sdk-1.3.11 lib/workato/extension/case_sensitive_headers.rb
workato-connector-sdk-1.3.10 lib/workato/extension/case_sensitive_headers.rb
workato-connector-sdk-1.3.9 lib/workato/extension/case_sensitive_headers.rb
workato-connector-sdk-1.3.8 lib/workato/extension/case_sensitive_headers.rb
workato-connector-sdk-1.3.7 lib/workato/extension/case_sensitive_headers.rb
workato-connector-sdk-1.3.6 lib/workato/extension/case_sensitive_headers.rb
workato-connector-sdk-1.3.5 lib/workato/extension/case_sensitive_headers.rb
workato-connector-sdk-1.3.4 lib/workato/extension/case_sensitive_headers.rb
workato-connector-sdk-1.3.3 lib/workato/extension/case_sensitive_headers.rb
workato-connector-sdk-1.3.2 lib/workato/extension/case_sensitive_headers.rb
workato-connector-sdk-1.3.1 lib/workato/extension/case_sensitive_headers.rb
workato-connector-sdk-1.3.0 lib/workato/extension/case_sensitive_headers.rb