File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
lib/elasticsearch/transport
spec/elasticsearch/transport Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -244,7 +244,7 @@ def __auto_detect_adapter
244
244
# Credentials is the base64 encoding of id and api_key joined by a colon
245
245
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html
246
246
def __encode ( api_key )
247
- Base64 . encode64 ( [ api_key [ :id ] , api_key [ :api_key ] ] . join ( ':' ) )
247
+ Base64 . strict_encode64 ( [ api_key [ :id ] , api_key [ :api_key ] ] . join ( ':' ) )
248
248
end
249
249
end
250
250
end
Original file line number Diff line number Diff line change 63
63
it 'Adds the ApiKey header to the connection' do
64
64
expect (
65
65
client . transport . connections . first . connection . headers [ 'Authorization' ]
66
- ) . to eq ( "ApiKey #{ Base64 . encode64 ( 'my_id:my_api_key' ) } " )
66
+ ) . to eq ( "ApiKey #{ Base64 . strict_encode64 ( 'my_id:my_api_key' ) } " )
67
67
end
68
68
end
69
69
You can’t perform that action at this time.
0 commit comments