Skip to content

Commit 6ef0ffc

Browse files
authored
Update lib/logstash/inputs/elasticsearch.rb
1 parent 3f6c650 commit 6ef0ffc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/logstash/inputs/elasticsearch.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def register
301301
transport_options[:headers].merge!(setup_basic_auth(user, password))
302302
transport_options[:headers].merge!(setup_api_key(api_key))
303303
transport_options[:headers].merge!({'user-agent' => prepare_user_agent()})
304-
transport_options[:headers].merge!(@custom_headers) if @custom_headers
304+
transport_options[:headers].merge!(@custom_headers) unless @custom_headers.empty?
305305
transport_options[:request_timeout] = @request_timeout_seconds unless @request_timeout_seconds.nil?
306306
transport_options[:connect_timeout] = @connect_timeout_seconds unless @connect_timeout_seconds.nil?
307307
transport_options[:socket_timeout] = @socket_timeout_seconds unless @socket_timeout_seconds.nil?

0 commit comments

Comments
 (0)