Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

quatrix: fix Content-Range header

Volodymyr2abeda596161
diff --git a/backend/quatrix/quatrix.go b/backend/quatrix/quatrix.go
index dab1f5f77..e615ac49e 100644
--- a/backend/quatrix/quatrix.go
+++ b/backend/quatrix/quatrix.go
@@ -1198,11 +1198,12 @@ func (o *Object) uploadSession(ctx context.Context, parentID, name string) (uplo
func (o *Object) upload(ctx context.Context, uploadKey string, chunk io.Reader, fullSize int64, offset int64, chunkSize int64, options ...fs.OpenOption) (err error) {
opts := rest.Opts{
- Method: "POST",
- RootURL: fmt.Sprintf(uploadURL, o.fs.opt.Host) + uploadKey,
- Body: chunk,
- ContentRange: fmt.Sprintf("bytes %d-%d/%d", offset, offset+chunkSize, fullSize),
- Options: options,
+ Method: "POST",
+ RootURL: fmt.Sprintf(uploadURL, o.fs.opt.Host) + uploadKey,
+ Body: chunk,
+ ContentLength: &chunkSize,
+ ContentRange: fmt.Sprintf("bytes %d-%d/%d", offset, offset+chunkSize-1, fullSize),
+ Options: options,
}
var fileID string