Add the ability to disable the creation extension on the client #137
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The TUS protocol specifies that the Creation step is an optional extension of the core protocol, so the TUSKit library shouldn't assume that servers supports it. Currently if a server doesn't support creation, the TUSKit client will fail to upload completely. Ideally the TUSKit library should check the server for supported extensions via an
OPTIONS
request like mentioned in the protocol docs. To bridge this issue in the short term, I think the user should be able to specify which extensions the TUSKit client should use. (Creation is currently the only extension that I saw implemented in the TUSKit client)There's more discussion on this topic in issue #134.
An example of a server that supports the Core TUS protocol but not the Creation extension is Vimeo's video upload api (as of api version 3.4).
My quick fix proposal is to include
supportedExtensions: [TUSProtocolExtension] = [.creation]
to the TUSClient parameters. Having the default be[.creation]
prevents breaking any current usages.