Skip to content

Commit a58ade6

Browse files
committed
[CLIENT] Fix Curb unit test, expecting headers to be merged and not set
1 parent 2f3ad2f commit a58ade6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

elasticsearch-transport/lib/elasticsearch/transport/transport/http/curb.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def perform_request(method, path, params={}, body=nil, headers=nil)
4646

4747
if headers
4848
if connection.connection.headers
49-
connection.connection.headers.merge(headers)
49+
connection.connection.headers.merge!(headers)
5050
else
5151
connection.connection.headers = headers
5252
end

elasticsearch-transport/test/unit/transport_curb_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class Elasticsearch::Transport::Transport::HTTP::FaradayTest < Minitest::Test
5757
should "perform request with headers" do
5858
@transport.connections.first.connection.expects(:put_data=).with('{"foo":"bar"}')
5959
@transport.connections.first.connection.expects(:http).with(:POST).returns(stub_everything)
60-
@transport.connections.first.connection.expects(:headers=).with({"Content-Type" => "application/x-ndjson"})
60+
@transport.connections.first.connection.headers.expects(:merge!).with("Content-Type" => "application/x-ndjson")
6161

6262
@transport.perform_request 'POST', '/', {}, {:foo => 'bar'}, {"Content-Type" => "application/x-ndjson"}
6363
end

0 commit comments

Comments
 (0)