Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #805 from jem/master

Allow custom headers in Storage#put_object_url
  • Loading branch information...
commit e0437b45969aef6a4990674ad86238499ce218c1 2 parents f9e25a6 + f3431cb
@geemus geemus authored
View
12 lib/fog/aws/requests/storage/put_object_url.rb
@@ -17,15 +17,15 @@ class Real
# ==== See Also
# http://docs.amazonwebservices.com/AmazonS3/latest/dev/S3_QSAuth.html
- def put_object_url(bucket_name, object_name, expires)
+ def put_object_url(bucket_name, object_name, expires, headers = {})
unless bucket_name
raise ArgumentError.new('bucket_name is required')
end
unless object_name
raise ArgumentError.new('object_name is required')
end
- url({
- :headers => {},
+ https_url({
+ :headers => headers,
:host => @host,
:method => 'PUT',
:path => "#{bucket_name}/#{object_name}"
@@ -36,15 +36,15 @@ def put_object_url(bucket_name, object_name, expires)
class Mock # :nodoc:all
- def put_object_url(bucket_name, object_name, expires)
+ def put_object_url(bucket_name, object_name, expires, headers = {})
unless bucket_name
raise ArgumentError.new('bucket_name is required')
end
unless object_name
raise ArgumentError.new('object_name is required')
end
- url({
- :headers => {},
+ https_url({
+ :headers => headers,
:host => @host,
:method => 'PUT',
:path => "#{bucket_name}/#{object_name}"
View
12 lib/fog/google/requests/storage/put_object_url.rb
@@ -14,15 +14,15 @@ class Real
# * response<~Excon::Response>:
# * body<~String> - url for object
#
- def put_object_url(bucket_name, object_name, expires)
+ def put_object_url(bucket_name, object_name, expires, headers = {})
unless bucket_name
raise ArgumentError.new('bucket_name is required')
end
unless object_name
raise ArgumentError.new('object_name is required')
end
- url({
- :headers => {},
+ https_url({
+ :headers => headers,
:host => @host,
:method => 'PUT',
:path => "#{bucket_name}/#{object_name}"
@@ -33,15 +33,15 @@ def put_object_url(bucket_name, object_name, expires)
class Mock
- def put_object_url(bucket_name, object_name, expires)
+ def put_object_url(bucket_name, object_name, expires, headers = {})
unless bucket_name
raise ArgumentError.new('bucket_name is required')
end
unless object_name
raise ArgumentError.new('object_name is required')
end
- url({
- :headers => {},
+ https_url({
+ :headers => headers,
:host => @host,
:method => 'PUT',
:path => "#{bucket_name}/#{object_name}"
Please sign in to comment.
Something went wrong with that request. Please try again.