react-s3-uploader
Advanced tools
Comparing version 4.1.1 to 4.2.0
##### 4.2.0 | ||
* Switch to `uuid` instead of `node-uuid` [#115] | ||
* Not using `React.DOM.input` [#127] | ||
* Allow function for `signingUrlHeaders` | ||
* Support setting headers in `signResult` callback | ||
##### 4.1.1 | ||
@@ -3,0 +10,0 @@ |
{ | ||
"name": "react-s3-uploader", | ||
"version": "4.1.1", | ||
"version": "4.2.0", | ||
"description": "React component that renders a file input and automatically uploads to an S3 bucket", | ||
@@ -29,5 +29,5 @@ "main": "index.js", | ||
"create-react-class": "^15.5.2", | ||
"node-uuid": "1.x", | ||
"object-assign": "^2.0.0", | ||
"prop-types": "^15.5.8" | ||
"prop-types": "^15.5.8", | ||
"uuid": "^3.1.0" | ||
}, | ||
@@ -34,0 +34,0 @@ "peerDependencies": { |
@@ -20,3 +20,6 @@ "use strict"; | ||
signingUrlMethod: PropTypes.string, | ||
signingUrlHeaders: PropTypes.object, | ||
signingUrlHeaders: PropTypes.oneOfType([ | ||
PropTypes.object, | ||
PropTypes.func | ||
]), | ||
signingUrlQueryParams: PropTypes.oneOfType([ | ||
@@ -85,3 +88,3 @@ PropTypes.object, | ||
render: function() { | ||
return React.DOM.input(this.getInputProps()); | ||
return React.createElement('input', this.getInputProps()); | ||
}, | ||
@@ -88,0 +91,0 @@ |
@@ -119,3 +119,3 @@ react-s3-uploader | ||
ACL: 'private', // this is default | ||
uniquePrefix=true // (4.0.2 and above) default is true, setting the attribute to false preserves the original filename in S3 | ||
uniquePrefix: true // (4.0.2 and above) default is true, setting the attribute to false preserves the original filename in S3 | ||
})); | ||
@@ -122,0 +122,0 @@ ``` |
@@ -1,3 +0,2 @@ | ||
var uuid = require('node-uuid'), | ||
var uuidv4 = require('uuid/v4'), | ||
aws = require('aws-sdk'), | ||
@@ -70,3 +69,3 @@ express = require('express'); | ||
router.get('/sign', function(req, res) { | ||
var filename = (options.uniquePrefix ? uuid.v4() + "_" : "") + req.query.objectName; | ||
var filename = (options.uniquePrefix ? uuidv4() + "_" : "") + req.query.objectName; | ||
var mimeType = req.query.contentType; | ||
@@ -73,0 +72,0 @@ var fileKey = checkTrailingSlash(getFileKeyDir(req)) + filename; |
@@ -91,3 +91,3 @@ /** | ||
if (this.signingUrlHeaders) { | ||
var signingUrlHeaders = this.signingUrlHeaders; | ||
var signingUrlHeaders = typeof this.signingUrlHeaders === 'function' ? this.signingUrlHeaders() : this.signingUrlHeaders; | ||
Object.keys(signingUrlHeaders).forEach(function(key) { | ||
@@ -154,2 +154,9 @@ var val = signingUrlHeaders[key]; | ||
} | ||
if (signResult.headers) { | ||
var signResultHeaders = signResult.headers | ||
Object.keys(signResultHeaders).forEach(function(key) { | ||
var val = signResultHeaders[key]; | ||
xhr.setRequestHeader(key, val); | ||
}) | ||
} | ||
if (this.uploadRequestHeaders) { | ||
@@ -156,0 +163,0 @@ var uploadRequestHeaders = this.uploadRequestHeaders; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24376
364
+ Addeduuid@^3.1.0
+ Addeduuid@3.4.0(transitive)
- Removednode-uuid@1.x
- Removednode-uuid@1.4.8(transitive)