mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #646 from autohaus24/master
add query options for s3 to support response headers overwriting
This commit is contained in:
commit
bf66bc1a0f
5 changed files with 15 additions and 12 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,6 +2,7 @@
|
||||||
*.gem
|
*.gem
|
||||||
*.rbc
|
*.rbc
|
||||||
*.sw?
|
*.sw?
|
||||||
|
.rvmrc
|
||||||
.bundle
|
.bundle
|
||||||
.DS_Store
|
.DS_Store
|
||||||
coverage
|
coverage
|
||||||
|
|
|
@ -123,9 +123,9 @@ module Fog
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
def url(expires)
|
def url(expires, options = {})
|
||||||
requires :key
|
requires :key
|
||||||
collection.get_https_url(key, expires)
|
collection.get_https_url(key, expires, options)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -78,14 +78,14 @@ module Fog
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_http_url(key, expires)
|
def get_http_url(key, expires, options = {})
|
||||||
requires :directory
|
requires :directory
|
||||||
connection.get_object_http_url(directory.key, key, expires)
|
connection.get_object_http_url(directory.key, key, expires, options)
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_https_url(key, expires)
|
def get_https_url(key, expires, options = {})
|
||||||
requires :directory
|
requires :directory
|
||||||
connection.get_object_https_url(directory.key, key, expires)
|
connection.get_object_https_url(directory.key, key, expires, options)
|
||||||
end
|
end
|
||||||
|
|
||||||
def head(key, options = {})
|
def head(key, options = {})
|
||||||
|
|
|
@ -4,7 +4,7 @@ module Fog
|
||||||
|
|
||||||
module GetObjectHttpUrl
|
module GetObjectHttpUrl
|
||||||
|
|
||||||
def get_object_http_url(bucket_name, object_name, expires)
|
def get_object_http_url(bucket_name, object_name, expires, options = {})
|
||||||
unless bucket_name
|
unless bucket_name
|
||||||
raise ArgumentError.new('bucket_name is required')
|
raise ArgumentError.new('bucket_name is required')
|
||||||
end
|
end
|
||||||
|
@ -15,7 +15,8 @@ module Fog
|
||||||
:headers => {},
|
:headers => {},
|
||||||
:host => @host,
|
:host => @host,
|
||||||
:method => 'GET',
|
:method => 'GET',
|
||||||
:path => "#{bucket_name}/#{object_name}"
|
:path => "#{bucket_name}/#{object_name}",
|
||||||
|
:query => options[:query]
|
||||||
}, expires)
|
}, expires)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ module Fog
|
||||||
|
|
||||||
module GetObjectHttpsUrl
|
module GetObjectHttpsUrl
|
||||||
|
|
||||||
def get_object_https_url(bucket_name, object_name, expires)
|
def get_object_https_url(bucket_name, object_name, expires, options = {})
|
||||||
unless bucket_name
|
unless bucket_name
|
||||||
raise ArgumentError.new('bucket_name is required')
|
raise ArgumentError.new('bucket_name is required')
|
||||||
end
|
end
|
||||||
|
@ -15,7 +15,8 @@ module Fog
|
||||||
:headers => {},
|
:headers => {},
|
||||||
:host => @host,
|
:host => @host,
|
||||||
:method => 'GET',
|
:method => 'GET',
|
||||||
:path => "#{bucket_name}/#{object_name}"
|
:path => "#{bucket_name}/#{object_name}",
|
||||||
|
:query => options[:query]
|
||||||
}, expires)
|
}, expires)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue