diff --git a/lib/google/apis/core/base_service.rb b/lib/google/apis/core/base_service.rb index cb368caed..b5315d0c2 100644 --- a/lib/google/apis/core/base_service.rb +++ b/lib/google/apis/core/base_service.rb @@ -400,7 +400,10 @@ module Google def new_client client = ::HTTPClient.new - client.transparent_gzip_decompression = true + if client_options.transparent_gzip_decompression + client.transparent_gzip_decompression = client_options.transparent_gzip_decompression + end + client.proxy = client_options.proxy_url if client_options.proxy_url if client_options.open_timeout_sec diff --git a/lib/google/apis/options.rb b/lib/google/apis/options.rb index 69be662a6..9b617d483 100644 --- a/lib/google/apis/options.rb +++ b/lib/google/apis/options.rb @@ -22,7 +22,8 @@ module Google :open_timeout_sec, :read_timeout_sec, :send_timeout_sec, - :log_http_requests) + :log_http_requests, + :transparent_gzip_decompression) RequestOptions = Struct.new( :authorization, @@ -47,6 +48,8 @@ module Google # @return [Fixnum] How long, in seconds, before failed connections time out # @!attribute [rw] read_timeout_sec # @return [Fixnum] How long, in seconds, before requests time out + # @!attribute [rw] transparent_gzip_decompression + # @return [Boolean] True if gzip compression needs to be enabled # Get the default options # @return [Google::Apis::ClientOptions] def self.default @@ -92,6 +95,7 @@ module Google ClientOptions.default.log_http_requests = false ClientOptions.default.application_name = 'unknown' ClientOptions.default.application_version = '0.0.0' + ClientOptions.default.transparent_gzip_decompression = true RequestOptions.default.retries = 0 RequestOptions.default.normalize_unicode = false RequestOptions.default.skip_serialization = false