|
@@ -16,6 +16,8 @@ module.exports = class AwsS3 extends Plugin {
|
|
|
}
|
|
|
|
|
|
const defaultOptions = {
|
|
|
+ timeout: 30 * 1000,
|
|
|
+ limit: 0,
|
|
|
getUploadParameters: this.getUploadParameters.bind(this),
|
|
|
locale: defaultLocale
|
|
|
}
|
|
@@ -114,9 +116,11 @@ module.exports = class AwsS3 extends Plugin {
|
|
|
install () {
|
|
|
this.uppy.addPreProcessor(this.prepareUpload)
|
|
|
|
|
|
- this.uppy.use(XHRUpload, Object.assign({
|
|
|
+ this.uppy.use(XHRUpload, {
|
|
|
fieldName: 'file',
|
|
|
responseUrlFieldName: 'location',
|
|
|
+ timeout: this.opts.timeout,
|
|
|
+ limit: this.opts.limit,
|
|
|
getResponseData (xhr) {
|
|
|
// If no response, we've hopefully done a PUT request to the file
|
|
|
// in the bucket on its full URL.
|
|
@@ -142,7 +146,7 @@ module.exports = class AwsS3 extends Plugin {
|
|
|
const error = xhr.responseXML.querySelector('Error > Message')
|
|
|
return new Error(error.textContent)
|
|
|
}
|
|
|
- }, this.opts.xhrOptions || {}))
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
uninstall () {
|