aws-sdk-v1 1.65.0 → 1.66.0
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.
- checksums.yaml +4 -4
- data/lib/aws/s3/client.rb +24 -9
- data/lib/aws/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15aa8aabcff05a8faa7cbf9665cc3c3b9c0a0604
|
4
|
+
data.tar.gz: 31904ed8985793ba348f87c1a9e79e8711a50805
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2337c54355dffa023f13a94e9ce085cdd14a052965ab9d6f63999ee674fa774d9e2b4bd003faf97d00dd5229131e14a9ad243c1537bad56e0bc653fc37c003d9
|
7
|
+
data.tar.gz: e8100c87dd17c61a3f8607cfabbe144ad0a9150b6e0a878db6cf65e6e57af99811a26de3b21b3aa4e6952b65df90838eacf2604b95be326d051feca8d195a123
|
data/lib/aws/s3/client.rb
CHANGED
@@ -19,6 +19,7 @@ require 'json'
|
|
19
19
|
require 'digest/md5'
|
20
20
|
require 'base64'
|
21
21
|
require 'nokogiri'
|
22
|
+
require 'set'
|
22
23
|
|
23
24
|
module AWS
|
24
25
|
class S3
|
@@ -38,6 +39,12 @@ module AWS
|
|
38
39
|
|
39
40
|
XMLNS = "http://s3.amazonaws.com/doc/#{API_VERSION}/"
|
40
41
|
|
42
|
+
HTTP_200_ERROR_OPERATIONS = Set.new([
|
43
|
+
:complete_multipart_upload,
|
44
|
+
:copy_object,
|
45
|
+
:copy_part,
|
46
|
+
])
|
47
|
+
|
41
48
|
autoload :XML, 'aws/s3/client/xml'
|
42
49
|
|
43
50
|
# @api private
|
@@ -168,8 +175,10 @@ module AWS
|
|
168
175
|
|
169
176
|
def extract_error_details response
|
170
177
|
if
|
171
|
-
(
|
172
|
-
response.
|
178
|
+
(
|
179
|
+
response.http_response.status >= 300 ||
|
180
|
+
HTTP_200_ERROR_OPERATIONS.include?(response.request_type)
|
181
|
+
) and
|
173
182
|
body = response.http_response.body and
|
174
183
|
error = Core::XML::Parser.parse(body) and
|
175
184
|
error[:code]
|
@@ -196,16 +205,22 @@ module AWS
|
|
196
205
|
end
|
197
206
|
|
198
207
|
def retryable_error? response
|
199
|
-
super
|
200
|
-
|
208
|
+
super ||
|
209
|
+
http_200_error?(response) ||
|
201
210
|
response.error.is_a?(Errors::RequestTimeout)
|
202
211
|
end
|
203
212
|
|
204
|
-
# S3 may return a 200
|
205
|
-
#
|
206
|
-
#
|
207
|
-
|
208
|
-
|
213
|
+
# S3 may return with a 200 status code in the response, but still
|
214
|
+
# embed an error in the body for the following operations:
|
215
|
+
#
|
216
|
+
# * `#complete_multipart_upload`
|
217
|
+
# * `#copy_object`
|
218
|
+
# * `#copy_part`
|
219
|
+
#
|
220
|
+
# To ensure the response is not in error, we have to parse
|
221
|
+
# it before the normal parser.
|
222
|
+
def http_200_error? response
|
223
|
+
HTTP_200_ERROR_OPERATIONS.include?(response.request_type) &&
|
209
224
|
extract_error_details(response)
|
210
225
|
end
|
211
226
|
|
data/lib/aws/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-v1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.66.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|