Skip to content

Commit

Permalink
Add version to user agent (#20)
Browse files Browse the repository at this point in the history
* add version to user agent

* 0.5.5
  • Loading branch information
MockusTravelTime authored Mar 13, 2023
1 parent 69e09ff commit 0855838
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/travel_time/middleware/authentication.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Authentication < Faraday::Middleware
def on_request(env)
env.request_headers[APP_ID_HEADER] = TravelTime.config.application_id
env.request_headers[API_KEY_HEADER] = TravelTime.config.api_key
env.request_headers[USER_AGENT] = 'Travel Time Ruby SDK'
env.request_headers[USER_AGENT] = "Travel Time Ruby SDK #{TravelTime::VERSION}"
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/travel_time/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module TravelTime
VERSION = '0.5.4'
VERSION = '0.5.5'
end
2 changes: 1 addition & 1 deletion spec/travel_time/middleware/authentication_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
it 'automatically adds User-Agent header' do
middleware.on_request(faraday_env)
value = faraday_env.request_headers[described_class::USER_AGENT]
expected = 'Travel Time Ruby SDK'
expected = "Travel Time Ruby SDK #{TravelTime::VERSION}"
expect(value).to eq(expected)
end
end

0 comments on commit 0855838

Please sign in to comment.