From 748c43d525c67892398c20cfb94a4d1d9b0c08b1 Mon Sep 17 00:00:00 2001 From: IoT Maestro Date: Thu, 28 Mar 2024 08:02:52 +0000 Subject: [PATCH] ulozto: set Content-Length header if the file size is known. --- backend/ulozto/ulozto.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/ulozto/ulozto.go b/backend/ulozto/ulozto.go index b5033107a..cf92de32a 100644 --- a/backend/ulozto/ulozto.go +++ b/backend/ulozto/ulozto.go @@ -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) {