tus / tus-resumable-upload-protocol

Open Protocol for Resumable File Uploads
https://tus.io
MIT License
1.48k stars 103 forks source link

Support zero length uploads #196

Closed bluetianx closed 4 months ago

bluetianx commented 4 months ago

if UploadLength is set to zero without setting IsUploadDeferLength to true, is this case reasonable in Creation of Protocol Extensions? I do not find detail about that

Acconut commented 4 months ago

Yes, Upload-Length can be 0. The spec only requires the header to be non-negative, so 0 is explicitly included.

The Upload-Length request and response header indicates the size of the entire upload in bytes. The value MUST be a non-negative integer.

bluetianx commented 4 months ago

The spec only requires the header to be non-negative

I can not find it in Creation of Protocol Extensions, but I can see it in Patch Protocol. Shall we fill it in Creation of Protocol Extensions?

Acconut commented 4 months ago

I can not find it in Creation of Protocol Extensions, but I can see it in Patch Protocol. Shall we fill it in Creation of Protocol Extensions?

We can add a statement to explain that zero-length uploads are explicitly allowed, yes.

Acconut commented 4 months ago

@bluetianx Would the changes in https://github.com/tus/tus-resumable-upload-protocol/pull/197 have helped you understand this?

bluetianx commented 4 months ago

For sure, Thank you @Acconut