tus / tus-js-client

A pure JavaScript client for the tus resumable upload protocol
https://tus.io/
MIT License
2.11k stars 316 forks source link

Upload against a deferred resource does not work without options.uploadLengthDeferred #182

Open mmatuska opened 4 years ago

mmatuska commented 4 years ago

Describe the bug If a remote resource is deferred and the server reports the "Upload-Defer-Length: 1" header, tus-js-client is not able to upload against the resource without options.uploadLengthDeferred. The protocol does not enfoce this. Upload-Length can be sent with the very next PATCH request.

To Reproduce Create a deferred resource.

curl -v -X POST -H 'Tus-Resumable: 1.0.0' -H 'Upload-Defer-Length: 1' https://master.tus.io/files

Try to upload against the resource without options.uploadLengthDeferred Error: "tus: invalid or missing length value"

Expected behavior It should be possible to upload against the deferred resource without options.uploadLengthDeferred

Setup details

Acconut commented 4 years ago

Thank you for reporting this! I agree with you that this should not happen. Seeing that you already worked on a patch, would you be willing to submit a PR for this?