Convert query values explicitly to strings (#810)

This commit is contained in:
Daniel Azuma authored and GitHub committed 2019-07-29 11:29:32 -07:00
1 parent b314e0df2b
commit 4e38887c1f
2 files changed
+19 -1

No files matched your search

+8 -1
View File
@@ -156,7 +156,7 @@ module Google
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 || {})
url.query_values = normalize_query_values(query).merge(url.query_values || {})
if allow_form_encoding?
@form_encoded = true
@@ -422,6 +422,13 @@ module Google
end
end
def normalize_query_values(input)
input.inject({}) do |h, (k, v)|
h[k] = normalize_query_value(v)
h
end
end
def normalize_query_value(v)
case v
when Array