Skip to content

Commit

Permalink
fix: can overwrite sdk header
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew committed Feb 6, 2025
1 parent 169221b commit af03c44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/unleash/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ def http_headers
'User-Agent' => "UnleashClientRuby/#{Unleash::VERSION} #{RUBY_ENGINE}/#{RUBY_VERSION} [#{RUBY_PLATFORM}]",
'UNLEASH-INSTANCEID' => self.instance_id,
'UNLEASH-APPNAME' => self.app_name,
'Unleash-Client-Spec' => CLIENT_SPECIFICATION_VERSION
'Unleash-Client-Spec' => CLIENT_SPECIFICATION_VERSION,
'UNLEASH-SDK' => "unleash-client-ruby:#{Unleash::VERSION}"
}.merge!(generate_custom_http_headers)
headers['UNLEASH-CONNECTION-ID'] = @connection_id
headers['UNLEASH-SDK'] = "unleash-client-ruby:#{Unleash::VERSION}"
headers
end

Expand Down
2 changes: 1 addition & 1 deletion spec/unleash/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
config = Unleash::Configuration.new(
url: 'https://testurl/api',
app_name: 'test-app',
custom_http_headers: { 'X-API-KEY': '123', 'UNLEASH-CONNECTION-ID': 'ignore', 'UNLEASH-SDK': 'ignore' }
custom_http_headers: { 'X-API-KEY': '123', 'UNLEASH-CONNECTION-ID': 'ignore' }
)

expect{ config.validate! }.not_to raise_error
Expand Down

0 comments on commit af03c44

Please sign in to comment.