From d9f7faffb93f6b02cc8f5fc837a25206d50d2d9a Mon Sep 17 00:00:00 2001 From: csg01123119 Date: Wed, 6 Sep 2023 18:04:29 +0800 Subject: [PATCH 1/2] fix: _uploadPart opt.headers use copy --- lib/common/multipart.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/common/multipart.js b/lib/common/multipart.js index f9a798666..75839f30c 100644 --- a/lib/common/multipart.js +++ b/lib/common/multipart.js @@ -236,10 +236,7 @@ proto._uploadPart = async function _uploadPart(name, uploadId, partNo, data, opt const opt = {}; copy(options).to(opt); opt.headers = opt.headers || {}; - opt.headers = { - ...opt.headers, - 'Content-Length': data.size - }; + copy({ 'Content-Length': data.size }).to(opt.headers); // Uploading shards does not require x-oss server side encryption opt.headers = omit(opt.headers, ['x-oss-server-side-encryption']); From 8f21f80e3c55ff016d51f5077ae8cabe65816460 Mon Sep 17 00:00:00 2001 From: csg01123119 Date: Wed, 6 Sep 2023 18:14:05 +0800 Subject: [PATCH 2/2] fix: _uploadPart opt.headers use copy --- lib/common/multipart.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common/multipart.js b/lib/common/multipart.js index 75839f30c..b6cb1edb1 100644 --- a/lib/common/multipart.js +++ b/lib/common/multipart.js @@ -236,7 +236,7 @@ proto._uploadPart = async function _uploadPart(name, uploadId, partNo, data, opt const opt = {}; copy(options).to(opt); opt.headers = opt.headers || {}; - copy({ 'Content-Length': data.size }).to(opt.headers); + opt.headers['Content-Length'] = data.size; // Uploading shards does not require x-oss server side encryption opt.headers = omit(opt.headers, ['x-oss-server-side-encryption']);