aws-sdk 2.1658.0 → 2.1660.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.
package/dist/aws-sdk.js CHANGED
@@ -1,4 +1,4 @@
1
- // AWS SDK for JavaScript v2.1658.0
1
+ // AWS SDK for JavaScript v2.1660.0
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // License at https://sdk.amazonaws.com/js/BUNDLE_LICENSE.txt
4
4
  (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
@@ -197306,9 +197306,6 @@ module.exports={
197306
197306
  "glue": {
197307
197307
  "name": "Glue"
197308
197308
  },
197309
- "mobile": {
197310
- "name": "Mobile"
197311
- },
197312
197309
  "pricing": {
197313
197310
  "name": "Pricing",
197314
197311
  "cors": true
@@ -276293,7 +276290,7 @@ AWS.util.update(AWS, {
276293
276290
  /**
276294
276291
  * @constant
276295
276292
  */
276296
- VERSION: '2.1658.0',
276293
+ VERSION: '2.1660.0',
276297
276294
 
276298
276295
  /**
276299
276296
  * @api private
@@ -287556,17 +287553,21 @@ AWS.util.update(AWS.S3.prototype, {
287556
287553
  * @api private
287557
287554
  */
287558
287555
  extractErrorFrom200Response: function extractErrorFrom200Response(resp) {
287559
- if (!operationsWith200StatusCodeError[resp.request.operation]) return;
287556
+ var service = this.service ? this.service : this;
287557
+ if (!service.is200Error(resp) && !operationsWith200StatusCodeError[resp.request.operation]) {
287558
+ return;
287559
+ }
287560
287560
  var httpResponse = resp.httpResponse;
287561
- if (httpResponse.body && httpResponse.body.toString().match('<Error>')) {
287561
+ var bodyString = httpResponse.body && httpResponse.body.toString() || '';
287562
+ if (bodyString && bodyString.indexOf('</Error>') === bodyString.length - 8) {
287562
287563
  // Response body with '<Error>...</Error>' indicates an exception.
287563
287564
  // Get S3 client object. In ManagedUpload, this.service refers to
287564
287565
  // S3 client object.
287565
287566
  resp.data = null;
287566
- var service = this.service ? this.service : this;
287567
287567
  service.extractError(resp);
287568
+ resp.error.is200Error = true;
287568
287569
  throw resp.error;
287569
- } else if (!httpResponse.body || !httpResponse.body.toString().match(/<[\w_]/)) {
287570
+ } else if (!httpResponse.body || !bodyString.match(/<[\w_]/)) {
287570
287571
  // When body is empty or incomplete, S3 might stop the request on detecting client
287571
287572
  // side aborting the request.
287572
287573
  resp.data = null;
@@ -287577,13 +287578,54 @@ AWS.util.update(AWS.S3.prototype, {
287577
287578
  }
287578
287579
  },
287579
287580
 
287581
+ /**
287582
+ * @api private
287583
+ * @param resp - to evaluate.
287584
+ * @return true if the response has status code 200 but is an error.
287585
+ */
287586
+ is200Error: function is200Error(resp) {
287587
+ var code = resp && resp.httpResponse && resp.httpResponse.statusCode;
287588
+ if (code !== 200) {
287589
+ return false;
287590
+ }
287591
+ try {
287592
+ var req = resp.request;
287593
+ var outputMembers = req.service.api.operations[req.operation].output.members;
287594
+ var keys = Object.keys(outputMembers);
287595
+ for (var i = 0; i < keys.length; ++i) {
287596
+ var member = outputMembers[keys[i]];
287597
+ if (member.type === 'binary' && member.isStreaming) {
287598
+ return false;
287599
+ }
287600
+ }
287601
+
287602
+ var body = resp.httpResponse.body;
287603
+ if (body && body.byteLength !== undefined) {
287604
+ if (body.byteLength < 15 || body.byteLength > 3000) {
287605
+ // body is too short or long to be an error message.
287606
+ return false;
287607
+ }
287608
+ }
287609
+ if (!body) {
287610
+ return false;
287611
+ }
287612
+ var bodyString = body.toString();
287613
+ if (bodyString.indexOf('</Error>') === bodyString.length - 8) {
287614
+ return true;
287615
+ }
287616
+ } catch (e) {
287617
+ return false;
287618
+ }
287619
+ return false;
287620
+ },
287621
+
287580
287622
  /**
287581
287623
  * @return [Boolean] whether the error can be retried
287582
287624
  * @api private
287583
287625
  */
287584
287626
  retryableError: function retryableError(error, request) {
287585
- if (operationsWith200StatusCodeError[request.operation] &&
287586
- error.statusCode === 200) {
287627
+ if (error.is200Error ||
287628
+ (operationsWith200StatusCodeError[request.operation] && error.statusCode === 200)) {
287587
287629
  return true;
287588
287630
  } else if (request._requestRegionForBucket &&
287589
287631
  request.service.bucketRegionCache[request._requestRegionForBucket]) {
@@ -298565,7 +298607,7 @@ var LRUCache = /** @class */ (function () {
298565
298607
  }());
298566
298608
  exports.LRUCache = LRUCache;
298567
298609
  },{}],467:[function(require,module,exports){
298568
- // AWS SDK for JavaScript v2.1658.0
298610
+ // AWS SDK for JavaScript v2.1660.0
298569
298611
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
298570
298612
  // License at https://sdk.amazonaws.com/js/BUNDLE_LICENSE.txt
298571
298613
  require('./browser_loader');