tusd icon indicating copy to clipboard operation
tusd copied to clipboard

WIP: Support for the upcoming tus v2 protocol

Open Acconut opened this issue 2 years ago • 0 comments

Note: Do not confuse this PR with the branch for tusd v2.

This patch provides a first, rough support for the new, upcoming version v2 of the tus protocol. Details of its specification are currently discussed in https://github.com/tus/tus-v2. With this PR we can gain first experience about the aspects and issues with implementing the potential tus v2 specification.

This work is not yet ready for production. As details of the specification change, this PR will change as well.

Thing to do:

  • Abort any running Upload Transfer Requests, if a new one comes in.
  • Implement parsing and storing of Content-Type and Content-Disposition
  • Generate predictable hash from Upload-Tokens
  • Implement support in s3store and gcsstore.
  • Implement tests

Feedback for the specification:

  • This PR only accepts Upload Transfer Requests using the POST method. No support for other verbs is planned, at the moment.
  • The Upload-Offset header is not optional for the initial Upload Transfer Request. This makes parsing code for the server simpler.
  • The Upload-Incomplete header can also be falsy, while the spec requires it to always be truthy. This makes parsing code for the server simpler.
  • The Upload-Token should be hashed (e.g. SHA-256) to make server-side handling more predictable and less error-prone.
  • There is no support for sending a 104 intermediate response code, as Go does not support this yet.

Acconut avatar Nov 15 '21 22:11 Acconut