aws-sdk-v1 1.65.0 → 1.66.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b7e4fed855b8c1c08be328ca0417dedf9f1f80bd
4
- data.tar.gz: c8d8b47169e803822c8440e73ef145ad3a7f8483
3
+ metadata.gz: 15aa8aabcff05a8faa7cbf9665cc3c3b9c0a0604
4
+ data.tar.gz: 31904ed8985793ba348f87c1a9e79e8711a50805
5
5
  SHA512:
6
- metadata.gz: ff70ca83866d1aa33d40657a43faaffc7f4b64060d22e2d8f7b90c66780a9ba8a61c3bffb67ce2a9d1151804e1fd5be5b8abca4a04d9823abecb9ff882dab368
7
- data.tar.gz: 6c1a5fcf43226cde5ce29f2029b11e52dfd3ca92c21609db72fce3874341211d7d11b80b060c37b01ea165632e5f17ea96f38d35e3bcb93f79d052c0abc0ea83
6
+ metadata.gz: 2337c54355dffa023f13a94e9ce085cdd14a052965ab9d6f63999ee674fa774d9e2b4bd003faf97d00dd5229131e14a9ad243c1537bad56e0bc653fc37c003d9
7
+ data.tar.gz: e8100c87dd17c61a3f8607cfabbe144ad0a9150b6e0a878db6cf65e6e57af99811a26de3b21b3aa4e6952b65df90838eacf2604b95be326d051feca8d195a123
@@ -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
- (response.http_response.status >= 300 ||
172
- response.request_type == :complete_multipart_upload) and
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 or
200
- failed_multipart_upload?(response) or
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 response code in response to complete_multipart_upload
205
- # and then start streaming whitespace until it knows the final result.
206
- # At that time it sends an XML message with success or failure.
207
- def failed_multipart_upload? response
208
- response.request_type == :complete_multipart_upload &&
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
 
@@ -13,5 +13,5 @@
13
13
 
14
14
  module AWS
15
15
  # Current version of the AWS SDK for Ruby
16
- VERSION = '1.65.0'
16
+ VERSION = '1.66.0'
17
17
  end
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.65.0
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-08-20 00:00:00.000000000 Z
11
+ date: 2015-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri