Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to disable the creation extension on the client #137

Merged
merged 6 commits into from
Aug 7, 2022

Conversation

BradPatras
Copy link
Contributor

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.

@tursunovic
Copy link
Contributor

Hi @BradPatras,

Thank you for the PR. Since the Creation step is optional, and the TUSKit library should not assume that the server supports it out of the box, it could make sense to let the consumers explicitly declare this in the client rather than opting out. I will look into that for a future release, as well as the implementation of the OPTIONS request.

For now though, for backwards compatibility and existing usages, this change is welcome. Will create a new release tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants