lib/fog/storage/google_json/real.rb in fog-google-0.3.2 vs lib/fog/storage/google_json/real.rb in fog-google-0.4.0
- old
+ new
@@ -16,17 +16,16 @@
@client = initialize_google_client(options)
@storage_json = @client.discovered_api("storage", api_version)
end
def signature(params)
- string_to_sign =
- <<-DATA
+ string_to_sign = <<-DATA
#{params[:method]}
- #{params[:headers]['Content-MD5']}
- #{params[:headers]['Content-Type']}
- #{params[:headers]['Date']}
- DATA
+#{params[:headers]['Content-MD5']}
+#{params[:headers]['Content-Type']}
+#{params[:headers]['Date']}
+DATA
google_headers = {}
canonical_google_headers = ""
params[:headers].each do |key, value|
google_headers[key] = value if key[0..6] == "x-goog-"
@@ -43,10 +42,10 @@
canonical_resource << "#{CGI.escape(subdomain).downcase}/"
end
canonical_resource << params[:path].to_s
canonical_resource << "?"
for key in (params[:query] || {}).keys
- if %w(acl cors location logging requestPayment torrent versions versioning).include?(key)
+ if %w(acl cors location logging requestPayment versions versioning).include?(key)
canonical_resource << "#{key}&"
end
end
canonical_resource.chop!
string_to_sign << canonical_resource.to_s