Verified Commit 1c93ad07 authored by Chocobozzz's avatar Chocobozzz
Browse files

Fix object storage multipart upload

parent 8a7abfef
......@@ -29,6 +29,20 @@ function getClient () {
: undefined
})
// FIXME: https://github.com/aws/aws-sdk-js-v3/issues/2445 workaround
s3Client.middlewareStack.add(
(next, _context) => (args: any) => {
if (typeof args.request?.body === 'string' && args.request.body.includes('CompletedMultipartUpload')) {
args.request.body = args.request.body.replace(/CompletedMultipartUpload/g, 'CompleteMultipartUpload')
}
return next(args)
},
{
step: 'build',
priority: 'high'
}
)
logger.info('Initialized S3 client %s with region %s.', getEndpoint(), OBJECT_STORAGE.REGION, lTags())
return s3Client
......
......@@ -216,7 +216,7 @@ async function multiPartUpload (options: {
const completeUploadCommand = new CompleteMultipartUploadCommand({
Bucket: bucketInfo.BUCKET_NAME,
Key: objectStorageKey,
Key: key,
UploadId: createResponse.UploadId,
MultipartUpload: { Parts: parts }
})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment