[core] Adds fog User-Agent header

As discussed in #1026 this adds a User Agent HTTP header to help identify
the version of fog is accessing APIs.
This commit is contained in:
Paul Thornthwaite 2012-11-23 14:47:53 +00:00
parent 043b549eed
commit a07f3203a6
1 changed files with 1 additions and 0 deletions

View File

@ -2,6 +2,7 @@ module Fog
class Connection
def initialize(url, persistent=false, params={})
Excon.defaults[:headers]['User-Agent'] ||= "fog/#{Fog::VERSION}"
@excon = Excon.new(url, params)
@persistent = persistent
end