s3cp 1.1.10 → 1.1.11
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +7 -0
- data/lib/s3cp/utils.rb +14 -0
- data/lib/s3cp/version.rb +1 -1
- metadata +3 -3
data/History.txt
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
=== 1.1.11 (2012-12-13)
|
2
|
+
|
3
|
+
* Added: Support for requests with 'requester-pays' header (experimental).
|
4
|
+
To use, set environment variable S3CP_REQUESTER_PAYS to "1".
|
5
|
+
Details @ http://docs.amazonwebservices.com/AmazonS3/latest/dev/RequesterPaysBuckets.html
|
6
|
+
and http://docs.amazonwebservices.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
7
|
+
|
1
8
|
=== 1.1.10 (2012-12-13)
|
2
9
|
|
3
10
|
* Added: New `s3edit` command for easy editing of files.
|
data/lib/s3cp/utils.rb
CHANGED
@@ -211,3 +211,17 @@ module AWS
|
|
211
211
|
end
|
212
212
|
end
|
213
213
|
|
214
|
+
# Monkey-patch to add requester-pays support (experimental)
|
215
|
+
# http://docs.amazonwebservices.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
216
|
+
if ENV["S3CP_REQUESTER_PAYS"] =~ /(yes|on|1)/i
|
217
|
+
class AWS::S3::Request
|
218
|
+
def canonicalized_headers
|
219
|
+
headers["x-amz-request-payer"] = 'requester' # magic!
|
220
|
+
x_amz = headers.select{|name, value| name.to_s =~ /^x-amz-/i }
|
221
|
+
x_amz = x_amz.collect{|name, value| [name.downcase, value] }
|
222
|
+
x_amz = x_amz.sort_by{|name, value| name }
|
223
|
+
x_amz = x_amz.collect{|name, value| "#{name}:#{value}" }.join("\n")
|
224
|
+
x_amz == '' ? nil : x_amz
|
225
|
+
end
|
226
|
+
end
|
227
|
+
end
|
data/lib/s3cp/version.rb
CHANGED
metadata
CHANGED