diff --git a/CHANGELOG.md b/CHANGELOG.md index 9214beb3a..8ef09f5c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -106,7 +106,6 @@ PRs are welcome! Please do open an issue to discuss first if it's a big feature, - [ ] QA: add one integration test (or add to existing test) that uses more exotic (tus) options such as `useFastRemoteRetry` or `removeFingerprintOnSuccess` https://github.com/transloadit/uppy/issues/1327 (@arturi, @ifedapoolarewaju) - [x] @uppy/companion: investigate 423 and 500 issues with React Native + Url plugin when pause/resuming an upload - [x] companion: remove deprecated "authorized" endpoint -- [x] companion: remove default upload protocol - [x] companion: remove fallback `UPPYSERVER_*` env options - [x] companion: change OAuth access token transport diff --git a/packages/@uppy/companion/src/server/Uploader.js b/packages/@uppy/companion/src/server/Uploader.js index 510021f63..4e0cbeaad 100644 --- a/packages/@uppy/companion/src/server/Uploader.js +++ b/packages/@uppy/companion/src/server/Uploader.js @@ -93,11 +93,6 @@ class Uploader { * @returns {boolean} */ validateOptions (options) { - if (!Object.keys(PROTOCOLS).some((key) => PROTOCOLS[key] === options.protocol)) { - this._errRespMessage = 'Invalid upload protocol' - return false - } - // s3 uploads don't require upload destination // validation, because the destination is determined // by the server's s3 config @@ -162,7 +157,8 @@ class Uploader { * @param {Buffer | Buffer[]} chunk */ handleChunk (chunk) { - const protocol = this.options.protocol + // @todo a default protocol should not be set. We should ensure that the user specifies her protocol. + const protocol = this.options.protocol || PROTOCOLS.multipart // The download has completed; close the file and start an upload if necessary. if (chunk === null) { diff --git a/packages/@uppy/companion/test/__tests__/companion.js b/packages/@uppy/companion/test/__tests__/companion.js index c687c8003..7e084ebe9 100644 --- a/packages/@uppy/companion/test/__tests__/companion.js +++ b/packages/@uppy/companion/test/__tests__/companion.js @@ -63,17 +63,6 @@ describe('download provdier file', () => { .expect(200) .then((res) => expect(res.body.token).toBeTruthy()) }) - - test('download should fail if protocol is not specified', () => { - return request(authServer) - .post('/drive/get/README.md') - .set('uppy-auth-token', token) - .set('Content-Type', 'application/json') - .send({ - endpoint: 'http://master.tus.com/files' - }) - .expect(400) - }) }) describe('test authentication', () => { diff --git a/packages/@uppy/xhr-upload/src/index.js b/packages/@uppy/xhr-upload/src/index.js index 0979d47d5..171b3e528 100644 --- a/packages/@uppy/xhr-upload/src/index.js +++ b/packages/@uppy/xhr-upload/src/index.js @@ -324,7 +324,6 @@ module.exports = class XHRUpload extends Plugin { file.remote.url, Object.assign({}, file.remote.body, { endpoint: opts.endpoint, - protocol: 'multipart', size: file.data.size, fieldname: opts.fieldName, metadata: fields,