Sha256: 8daf81a5b155c2e54318a3c66f0d29d6cab233728b49c431f05a1c01bfc0af0e

Contents?: true

Size: 463 Bytes

Versions: 35

Compression:

Stored size: 463 Bytes

Contents

function addContentType(req) {
  var httpRequest = req.httpRequest || {};
  var headers = httpRequest.headers;
  // We don't want to force a content type on presigned urls
  if (headers && !req.isPresigned()) {
    if (httpRequest.body && !headers['Content-Type']) {
      // React Native's android XHR requires Content-Type to be defined if there is a body
      headers['Content-Type'] = '';
    }
  }
}

module.exports = {
    addContentType: addContentType
};

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
sumomo-0.10.8 data/sumomo/api_modules/node_modules/aws-sdk/lib/react-native/add-content-type.js
sumomo-0.10.4 data/sumomo/api_modules/node_modules/aws-sdk/lib/react-native/add-content-type.js
sumomo-0.10.3 data/sumomo/api_modules/node_modules/aws-sdk/lib/react-native/add-content-type.js
sumomo-0.10.2 data/sumomo/api_modules/node_modules/aws-sdk/lib/react-native/add-content-type.js
sumomo-0.10.1 data/sumomo/api_modules/node_modules/aws-sdk/lib/react-native/add-content-type.js
sumomo-0.10.0 data/sumomo/api_modules/node_modules/aws-sdk/lib/react-native/add-content-type.js
sumomo-0.9.0 data/sumomo/api_modules/node_modules/aws-sdk/lib/react-native/add-content-type.js
sumomo-0.8.22 data/sumomo/api_modules/node_modules/aws-sdk/lib/react-native/add-content-type.js
sumomo-0.8.21 data/sumomo/api_modules/node_modules/aws-sdk/lib/react-native/add-content-type.js
sumomo-0.8.20 data/sumomo/api_modules/node_modules/aws-sdk/lib/react-native/add-content-type.js
sumomo-0.8.17 data/sumomo/api_modules/node_modules/aws-sdk/lib/react-native/add-content-type.js
sumomo-0.8.16 data/sumomo/api_modules/node_modules/aws-sdk/lib/react-native/add-content-type.js
sumomo-0.8.15 data/sumomo/api_modules/node_modules/aws-sdk/lib/react-native/add-content-type.js
sumomo-0.8.14 data/sumomo/api_modules/node_modules/aws-sdk/lib/react-native/add-content-type.js
sumomo-0.8.13 data/sumomo/api_modules/node_modules/aws-sdk/lib/react-native/add-content-type.js
sumomo-0.8.12 data/sumomo/api_modules/node_modules/aws-sdk/lib/react-native/add-content-type.js
sumomo-0.8.11 data/sumomo/api_modules/node_modules/aws-sdk/lib/react-native/add-content-type.js
sumomo-0.8.10 data/sumomo/api_modules/node_modules/aws-sdk/lib/react-native/add-content-type.js
sumomo-0.8.9 data/sumomo/api_modules/node_modules/aws-sdk/lib/react-native/add-content-type.js
sumomo-0.8.8 data/sumomo/api_modules/node_modules/aws-sdk/lib/react-native/add-content-type.js