Module: Fog::Storage::Google::Utils

Included in:
Mock, Real
Defined in:
lib/fog/storage/google.rb

Instance Method Summary collapse

Instance Method Details

#url(params, expires) ⇒ Object



33
34
35
36
37
38
39
40
41
# File 'lib/fog/storage/google.rb', line 33

def url(params, expires)
  params[:headers]['Date'] = expires.to_i
  params[:path] = CGI.escape(params[:path]).gsub('%2F', '/')
  query = [params[:query]].compact
  query << "GoogleAccessKeyId=#{@google_storage_access_key_id}"
  query << "Signature=#{CGI.escape(signature(params))}"
  query << "Expires=#{params[:headers]['Date']}"
  "http://#{params[:host]}/#{params[:path]}?#{query.join('&')}"
end