diff --git a/google-apis-core/lib/google/apis/core/base_service.rb b/google-apis-core/lib/google/apis/core/base_service.rb index 38723fc4d07..a366e5f8432 100644 --- a/google-apis-core/lib/google/apis/core/base_service.rb +++ b/google-apis-core/lib/google/apis/core/base_service.rb @@ -557,6 +557,7 @@ def new_client Faraday.new options do |faraday| faraday.response :logger, Google::Apis.logger if client_options.log_http_requests faraday.response :follow_redirects_google_apis_core, limit: 5 + faraday.adapter client_options.adapter if client_options.adapter end end diff --git a/google-apis-core/lib/google/apis/options.rb b/google-apis-core/lib/google/apis/options.rb index 4445f7e90c4..9f8d79be288 100644 --- a/google-apis-core/lib/google/apis/options.rb +++ b/google-apis-core/lib/google/apis/options.rb @@ -18,6 +18,7 @@ module Apis ClientOptions = Struct.new( :application_name, :application_version, + :adapter, :proxy_url, :open_timeout_sec, :read_timeout_sec, @@ -50,6 +51,8 @@ class ClientOptions # @return [String] Name of the application, for identification in the User-Agent header # @!attribute [rw] application_version # @return [String] Version of the application, for identification in the User-Agent header + # @!attribute [rw] adapter + # @return [Symbol, Class] Faraday adapter to use # @!attribute [rw] proxy_url # @return [String] URL of a proxy server # @!attribute [rw] log_http_requests