lib/incognia_api/client.rb in incognia_api-0.5.1 vs lib/incognia_api/client.rb in incognia_api-0.5.2
- old
+ new
@@ -12,10 +12,15 @@
def initialize(client_id:, client_secret:, host:)
@client_id = client_id
@client_secret = client_secret
@host = host
- @connection = Faraday.new(host) do |faraday|
+ headers = { 'User-Agent' => "incognia-ruby/#{Incognia::VERSION} " \
+ "({#{RbConfig::CONFIG['host']}}) " \
+ "{#{RbConfig::CONFIG['arch']}} " \
+ "Ruby/#{RbConfig::CONFIG['ruby_version']}" }
+
+ @connection = Faraday.new(host, headers: headers) do |faraday|
faraday.request :json
faraday.response :json, content_type: /\bjson$/
faraday.response :raise_error
faraday.adapter Faraday.default_adapter