swift_client 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
 
2
2
  class SwiftClient
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
 
data/lib/swift_client.rb CHANGED
@@ -126,11 +126,11 @@ class SwiftClient
126
126
  raise(TempUrlKeyMissing) unless options[:temp_url_key]
127
127
 
128
128
  expires = (Time.now + (options[:expires_in] || 3600).to_i).to_i
129
- path = "/#{container}/#{object}"
129
+ path = URI.parse("#{storage_url}/#{container}/#{object}").path
130
130
 
131
131
  signature = OpenSSL::HMAC.hexdigest("sha1", options[:temp_url_key], "GET\n#{expires}\n#{path}")
132
132
 
133
- "#{storage_url}#{path}?temp_url_sig=#{signature}&temp_url_expires=#{expires}"
133
+ "#{storage_url}/#{container}/#{object}?temp_url_sig=#{signature}&temp_url_expires=#{expires}"
134
134
  end
135
135
 
136
136
  private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swift_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: