Skip to content

Commit

Permalink
@uppy/companion: use deferred length for tus streams (#4697)
Browse files Browse the repository at this point in the history
use uploadLengthDeferred for streams

with tus
as recommended in tus/tus-js-client#606
because sometimes HEAD reports an incorrect size
  • Loading branch information
mifi authored Sep 25, 2023
1 parent b1e4a5b commit 559616e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/@uppy/companion/src/server/Uploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,9 @@ class Uploader {
this.tus = new tus.Upload(stream, {
endpoint: this.options.endpoint,
uploadUrl: this.options.uploadUrl,
uploadLengthDeferred: false,
uploadLengthDeferred: !isFileStream,
retryDelays: [0, 1000, 3000, 5000],
uploadSize: this.size,
uploadSize: isFileStream ? this.size : undefined,
chunkSize,
headers: headerSanitize(this.options.headers),
addRequestId: true,
Expand Down

0 comments on commit 559616e

Please sign in to comment.