Skip to content

Commit 4b06c59

Browse files
committed
[CLIENT] Only add Accept-Encording header if compression option is true
1 parent 9e5e91e commit 4b06c59

File tree

1 file changed

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

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def apply_headers(request_options, options)
158158
headers = (options && options[:headers]) || {}
159159
headers[CONTENT_TYPE_STR] = find_value(headers, CONTENT_TYPE_REGEX) || DEFAULT_CONTENT_TYPE
160160
headers[USER_AGENT_STR] = find_value(headers, USER_AGENT_REGEX) || user_agent_header
161-
headers[ACCEPT_ENCODING] = GZIP
161+
headers[ACCEPT_ENCODING] = GZIP if use_compression?
162162
request_options.merge!(headers: headers)
163163
end
164164

0 commit comments

Comments
 (0)