apply_headers

in lib/elastic/transport/transport/http/manticore.rb [169:176]


          def apply_headers(options)
            headers = options[:headers].clone || options.dig(:transport_options, :headers).clone || {}
            headers[CONTENT_TYPE_STR] = find_value(headers, CONTENT_TYPE_REGEX) || DEFAULT_CONTENT_TYPE
            headers[USER_AGENT_STR] = find_value(headers, USER_AGENT_REGEX) || find_value(@request_options[:headers], USER_AGENT_REGEX) || user_agent_header
            headers[ACCEPT_ENCODING] = GZIP if use_compression?
            @request_options[:headers].merge!(headers)
          end