ulozto: set Content-Length header if the file size is known.

This commit is contained in:
IoT Maestro 2024-03-28 08:02:52 +00:00 committed by Nick Craig-Wood
parent 7c20ec3772
commit 748c43d525

View file

@ -346,6 +346,11 @@ func (f *Fs) uploadUnchecked(ctx context.Context, name, parentSlug string, info
MultipartFileName: encodedName,
Parameters: url.Values{},
}
if info.Size() > 0 {
size := info.Size()
opts.ContentLength = &size
}
var uploadResponse api.SendFilePayloadResponse
err = f.pacer.CallNoRetry(func() (bool, error) {