Skip to content

Commit

Permalink
[API] Test Runner: Stringify header keys, do not overwrite headers if…
Browse files Browse the repository at this point in the history
… set
  • Loading branch information
picandocodigo committed Dec 9, 2021
1 parent cca3498 commit c56e671
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api-spec-testing/test_file/action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ def execute(client, test = nil)
if headers[:Authorization] == 'Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA=='
headers.delete(:Authorization)
end
# Stringify keys:
headers = headers.transform_keys(&:to_s)
if ENV['QUIET'] == 'true'
# todo: create a method on Elasticsearch::Client that can clone the client with new options
Elasticsearch::Client.new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ def set_api_key

def set_compatibility_header
return unless ['1', 'true'].include?(ENV['ELASTIC_CLIENT_APIVERSIONING'])
return if instance_variable_get('@options').dig(:transport_options, :headers, 'Accept')

add_header(
{
Expand Down

0 comments on commit c56e671

Please sign in to comment.