-
Notifications
You must be signed in to change notification settings - Fork 81
Description
I have a couple questions regarding the concept of uploads finishing in the spec (https://tus.io/protocols/resumable-upload.html).
-
The
ExpirationandTerminationextensions talk about "finished" and "unfinished" uploads, but it is neither defined what that means nor stated that these terms are explicitly undefined and it is communicated out-of-band whether an upload is finished. The only cases where a concept of "finished" is easily available are:- In the
Concatenationextension, where one could easily argue that the "final" upload makes that upload "finished". - If the
Creationextension is used and eitherUpload-Lengthwas set at the beginning, orUpload-Defer-Lengthwas used and with a subsequentOnce it is known the Client MUST set the
Upload-Lengthheader in the nextPATCHrequest.
the length was learned, and that offset eventually reached.
But these are extensions; likely other independent extensions shouldn't depend on them for semantics.
- In the
-
The Core protocol has only 1 ocurrence of the
Upload-Lengthheader, namely in the response to theHEADrequest:If the size of the upload is known, the Server MUST include the
Upload-Lengthheader in the response.
Thus, it would be great to have the following clarifications stated somewhere explicit in the FAQ:
-
The Core protocol does not define a notion of when an upload is finished. At any given time it is unknown whether more data will be added to an Upload.
-
In the
Creationextension, regardingOnce it is known the Client MUST set the
Upload-Lengthheader in the nextPATCHrequest.there is the case that a client sent a previous
PATCHrequest, and then later learns that there is no more data. In this case, I suppose the client would send aPATCHrequest with an empty body and sets theUpload-Lengthheader for it (this is what e.g. thetus.pyclient does, see Setting ofUpload-Lengthwith emptyPATCHrequest? cenkalti/tus.py#8).
If this is how it's supposed to work, might be nice to state that in the FAQ, because implementing a server I wasn't at first sure what to do with emptyPATCHrequests.
I believe the following is a bit unclear in the spec:
- In the
Concatenationextension:The
Upload-Lengthheader MUST be included if the length of the final resource can be calculated at the time of the request.- Included in what, the final
POSTrequests that setUpload-Concat: partial? Or also thePATCHrequest, that transmit the data (similar to "set theUpload-Lengthheader in the nextPATCHrequest" from theCreationextension)? If the latter, it's confusing that this wording doesn't use "in the nextPATCHrequest; the current wording implies that if if the client knows the length all the way from the beginning to the end, theUpload-Lengthheader MUST be included in each of the request (but the subsequent "Example" doesn't show that happening).
It seems beneficial to me to word that logic exactly like in theCreationextension.
- Included in what, the final
Thanks for considering / answering those points!