lib/elasticsearch/transport/transport/http/faraday.rb in elasticsearch-transport-7.15.0 vs lib/elasticsearch/transport/transport/http/faraday.rb in elasticsearch-transport-7.16.0
- old
+ new
@@ -42,17 +42,18 @@
end
else
headers
end
- response = connection.connection.run_request(
- method.downcase.to_sym,
- url,
- (body ? __convert_to_json(body) : nil),
- headers
- )
+ body = body ? __convert_to_json(body) : nil
+ body, headers = compress_request(body, headers)
+ response = connection.connection.run_request(method.downcase.to_sym,
+ url,
+ body,
+ headers)
+
Response.new response.status, decompress_response(response.body), response.headers
end
end
# Builds and returns a connection
@@ -60,10 +61,10 @@
# @return [Connections::Connection]
#
def __build_connection(host, options={}, block=nil)
client = ::Faraday.new(__full_url(host), options, &block)
apply_headers(client, options)
- Connections::Connection.new :host => host, :connection => client
+ Connections::Connection.new(host: host, connection: client)
end
# Returns an array of implementation specific connection errors.
#
# @return [Array]