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

Fix to resolve "objectid is required for this operation" error message when calling public_url

This commit is contained in:
Michael Harrison 2012-10-17 13:33:42 +10:00
parent ba5b48a679
commit c9dd0eb5c2

View file

@ -59,7 +59,7 @@ module Fog
def public_url(expires = (Time.now + 5 * 365 * 24 * 60 * 60))
self.objectid = directory.files.head(key).attributes['x-emc-meta'].scan(/objectid=(\w+),/).flatten[0] if self.objectid.blank?
requires :objectid
uri = URI::HTTP.build(:scheme => @prefix, :host => @storage_host, :port => @storage_port.to_i, :path => "/rest/objects/#{self.objectid}" )
uri = URI::HTTP.build(:scheme => connection.ssl? ? "http" : "https" , :host => connection.host, :port => connection.port.to_i, :path => "/rest/objects/#{self.objectid}" )
sb = "GET\n"
sb += uri.path.downcase + "\n"