forked from packagethief/aws-s3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't include extra options in the request
- Loading branch information
1 parent
ba17303
commit 55c64b6
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55c64b6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any good reason not to merge the user-provided options into the hash that is parsed to put? Why even ask for the options if they are not used?
55c64b6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The options are used on line 185 to check whether we should also copy the acl.
55c64b6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True - missed that :)
And I can see a reason for not wanting to manipulate the headers during a copy since a copy is expected to copy without making any changes, but in my case I would like to set a Content-Disposition header on the copied object. I could of cause do this by performing an update just afterwards, but if allowing such a thing during a copy I would to save a HTTP request, which is always nice :)
Maybe it could be changed to this:
returning put(target_key, default_options.merge(options.reject {|k,v| k == :copy_acl})) do
or:
def copy(key, copy_key, bucket = nil, options = {}, aws_options = {})
...
returning put(target_key, default_options.merge(aws_options)) do
what do you think?
55c64b6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... Forked the repo and added this change, but it seems that Amazon ignores new headers like
:content_disposition
when given the:x-amz-copy-source
header. So I guess there is no other way than first doing the copy/rename and then following it up with an update afterwards :(