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']);