Fixed parameters encoding (should be urlencoded)

This commit is contained in:
Nikolay Mischenko 2012-02-15 16:25:48 +03:00 committed by Bob Aman
parent 17e540d0de
commit 2eb6da99d3
1 changed files with 5 additions and 3 deletions

View File

@ -172,12 +172,14 @@ module Google
query_parameters = parameters.reject do |k, v|
template_variables.include?(k)
end
if query_parameters.size > 0
uri.query_values = (uri.query_values || []) + query_parameters
# encode all non-template parameters
params = ""
unless query_parameters.empty?
params = "?" + Addressable::URI.form_encode(query_parameters)
end
# Normalization is necessary because of undesirable percent-escaping
# during URI template expansion
return uri.normalize
return uri.normalize + params
end
##