set a default user agent

This commit is contained in:
rick 2013-01-31 20:00:38 -07:00
parent 970ab0c5be
commit f6831b53b3

View File

@ -82,6 +82,8 @@ module Faraday
proxy(options.fetch(:proxy) { ENV['http_proxy'] }) proxy(options.fetch(:proxy) { ENV['http_proxy'] })
yield self if block_given? yield self if block_given?
@headers[:user_agent] ||= "Faraday v#{VERSION}"
end end
# Public: Sets the Hash of URI query unencoded key/value pairs. # Public: Sets the Hash of URI query unencoded key/value pairs.