Don't normalize unicode in templates (fixed #557 + GCS issues)

This commit is contained in:
Steve Bazyl committed 2017-03-30 12:33:49 -07:00
1 parent c4d0ed5d3c
commit 5447ddb7c0
6 files changed
+36 -6

No files matched your search

+6 -2
View File
@@ -139,8 +139,12 @@ module Google
# @private
# @return [void]
def prepare!
header.update(options.header) if options && options.header
self.url = url.expand(params) if url.is_a?(Addressable::Template)
normalize_unicode = true
if options
header.update(options.header) if options.header
normalize_unicode = options.normalize_unicode
end
self.url = url.expand(params, nil, normalize_unicode) if url.is_a?(Addressable::Template)
url.query_values = query.merge(url.query_values || {})
if allow_form_encoding?
+5 -2
View File
@@ -26,7 +26,8 @@ module Google
:retries,
:header,
:timeout_sec,
:open_timeout_sec)
:open_timeout_sec,
:normalize_unicode)
# General client options
class ClientOptions
@@ -56,6 +57,8 @@ module Google
# @return [Fixnum] How long, in seconds, before failed connections time out
# @!attribute [rw] header
# @return [Hash<String,String] Additional HTTP headers to include in requests
# @!attribute [rw] normalize_unicode
# @return [Boolean] True if unicode strings should be normalized in path parameters
# Get the default options
# @return [Google::Apis::RequestOptions]
@@ -78,8 +81,8 @@ module Google
ClientOptions.default.use_net_http = false
ClientOptions.default.application_name = 'unknown'
ClientOptions.default.application_version = '0.0.0'
RequestOptions.default.retries = 0
RequestOptions.default.open_timeout_sec = 20
RequestOptions.default.normalize_unicode = false
end
end