Skip to content

Commit

Permalink
feat: unleash-interval header
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew committed Feb 28, 2025
1 parent db3b949 commit ce5a93b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/unleash/metrics_reporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def post
end

headers = (Unleash.configuration.http_headers || {}).dup
headers.merge!( { 'UNLEASH-INTERVAL' => Unleash.configuration.metrics_interval.to_s })
headers.merge!({ 'UNLEASH-INTERVAL' => Unleash.configuration.metrics_interval.to_s })
response = Unleash::Util::Http.post(Unleash.configuration.client_metrics_uri, report.to_json, headers)

if ['200', '202'].include? response.code
Expand Down
2 changes: 1 addition & 1 deletion lib/unleash/toggle_fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def fetch
return if Unleash.configuration.disable_client

headers = (Unleash.configuration.http_headers || {}).dup
headers.merge!( { 'UNLEASH-INTERVAL' => Unleash.configuration.refresh_interval.to_s })
headers.merge!( {'UNLEASH-INTERVAL' => Unleash.configuration.refresh_interval.to_s })
response = Unleash::Util::Http.get(Unleash.configuration.fetch_toggles_uri, etag, headers)

if response.code == '304'
Expand Down
2 changes: 1 addition & 1 deletion spec/unleash/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
'User-Agent' => "UnleashClientRuby/#{Unleash::VERSION} #{RUBY_ENGINE}/#{RUBY_VERSION} [#{RUBY_PLATFORM}]",
'Unleash-Sdk' => "unleash-client-ruby:#{Unleash::VERSION}",
'X-Api-Key' => '123',
'X-Api-Key' => '123'
}
)
.to_return(status: 200, body: "", headers: {})
Expand Down

0 comments on commit ce5a93b

Please sign in to comment.