X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/349c26fa8bf0de53d915c81a03da65d99c53de0c..b14178ed3abb38af96dd896087b4b9e2a28e24f8:/lib/google/api_client.rb diff --git a/lib/google/api_client.rb b/lib/google/api_client.rb index ef3c2b1d34..b2fa0b3c44 100644 --- a/lib/google/api_client.rb +++ b/lib/google/api_client.rb @@ -111,7 +111,7 @@ module Google self.user_agent = options[:user_agent] || ( "#{application_string} " + - "google-api-ruby-client/#{Google::APIClient::VERSION::STRING} #{ENV::OS_VERSION} (gzip)" + "google-api-ruby-client/#{Google::APIClient::VERSION::STRING} #{ENV::OS_VERSION}".strip + " (gzip)" ).strip # The writer method understands a few Symbols and will generate useful # default authentication mechanisms. @@ -135,7 +135,13 @@ module Google faraday.options.params_encoder = Faraday::FlatParamsEncoder faraday.ssl.ca_file = ca_file faraday.ssl.verify = true - faraday.proxy proxy + if faraday.respond_to?(:proxy=) + # faraday >= 0.6.2 + faraday.proxy = proxy + else + # older versions of faraday + faraday.proxy proxy + end faraday.adapter Faraday.default_adapter if options[:faraday_option].is_a?(Hash) options[:faraday_option].each_pair do |option, value|