Skip to content

Commit

Permalink
fix: always return data on completeMultipartUpload (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 authored Dec 30, 2022
1 parent d40c638 commit 6c6e7f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/common/multipart.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ proto.completeMultipartUpload = async function completeMultipartUpload(name, upl
bucket: params.bucket,
name,
etag: result.res.headers.etag,
data: result.data,
};

if (params.headers && params.headers['x-oss-callback']) {
Expand Down
4 changes: 4 additions & 0 deletions test/multipart.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,10 @@ describe('test/multipart.test.js', () => {

const result = await store.completeMultipartUpload(name, uploadId, dones);
assert.equal(result.res.status, 200);
assert(result.data.Location.startsWith('https://'));
assert.equal(typeof result.data.Bucket, 'string');
assert.equal(result.data.Key, name);
assert.equal(typeof result.data.ETag, 'string');
});

it('should upload partSize be int number and greater then minPartSize', async () => {
Expand Down

0 comments on commit 6c6e7f5

Please sign in to comment.