Skip to content

Commit 001f012

Browse files
committed
[CLIENT] Use GZIP constant
1 parent 7684962 commit 001f012

File tree

1 file changed

+1
-2
lines changed
  • elasticsearch-transport/lib/elasticsearch/transport/transport/http

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def perform_request(method, path, params={}, body=nil, headers=nil)
5151
# @return [Connections::Connection]
5252
#
5353
def __build_connection(host, options={}, block=nil)
54-
options.merge!(headers: { accept_encoding: 'gzip' }) if use_compression?
54+
options.merge!(headers: { accept_encoding: GZIP }) if use_compression?
5555
client = ::Faraday.new(__full_url(host), options, &block)
5656
apply_headers(client, options)
5757
Connections::Connection.new :host => host, :connection => client
@@ -67,7 +67,6 @@ def host_unreachable_exceptions
6767

6868
private
6969

70-
GZIP = 'gzip'.freeze
7170
GZIP_FIRST_TWO_BYTES = '1f8b'.freeze
7271
HEX_STRING_DIRECTIVE = 'H*'.freeze
7372
RUBY_ENCODING = '1.9'.respond_to?(:force_encoding)

0 commit comments

Comments
 (0)