Revert "Merge pull request #1550 from transloadit/remove-default-protocol"

This reverts commit 3dd930d658, reversing
changes made to d1b5cc0602.
This commit is contained in:
Ifedapo Olarewaju 2019-05-17 13:24:38 +01:00
parent 1caea26a45
commit 248af15a8a
4 changed files with 2 additions and 19 deletions

View file

@ -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

View file

@ -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) {

View file

@ -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', () => {

View file

@ -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,