tus / tusd

Reference server implementation in Go of tus: the open protocol for resumable file uploads
https://tus.github.io/tusd
MIT License
2.92k stars 465 forks source link

Does the specification allow, disallow, or does not specify to upload empty (content-lenght 0) files? #1122

Open meidlinga opened 2 months ago

meidlinga commented 2 months ago

I have tried this, but currently the file gets handed to the storage handler (Azure in my case), which tries to upload it. Subsequently this fails and the tus client request gets rejected.

So I was wondering, if tus servers should allow this in the first place, before filing a more specific bug eventually.

Acconut commented 2 months ago

tus has always allowed empty uploads and just last week we received a similar question and added an explaining paragraph to the protocol: https://github.com/tus/tus-resumable-upload-protocol/pull/197

Does it not work for the azurestore?

meidlinga commented 2 months ago

Thanks for pointing this out.

I my case, I see, that tusd tries to upload a zero-length blob, and the azure client fails. I have not verified, I use the latest version though but looking at https://github.com/tus/tusd/blob/main/pkg/azurestore/azurestore.go I do not see a respective check before trying to upload.

I can test against master and file a respective bug with more information in the next days.

Acconut commented 2 months ago

I can test against master and file a respective bug with more information in the next days.

That would be great! Thank you very much!