1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

ensure apiKey and command are included in parameter sorting

This commit is contained in:
Sean Caffery 2012-05-08 17:52:11 +10:00
parent 9138147994
commit 644c090360

View file

@ -86,9 +86,9 @@ module Fog
def request(command, params, options)
params['response'] = "json"
req = "apiKey=#{@ninefold_compute_key}&command=#{command}&"
# convert params to strings for sort
req += URI.escape(params.sort_by{|k,v| k.to_s }.collect{|e| "#{e[0].to_s}=#{e[1].to_s}"}.join('&'))
req_params = params.merge('apiKey' => @ninefold_compute_key, 'command' => command)
req = URI.escape(req_params.sort_by{|k,v| k.to_s }.collect{|e| "#{e[0].to_s}=#{e[1].to_s}"}.join('&'))
encoded_signature = url_escape(encode_signature(req))
options = {