mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2024-12-01 21:09:17 -06:00
Fix object storage multipart upload
This commit is contained in:
parent
8a7abfef88
commit
1c93ad0778
@ -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 }
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user