mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-17 16:50:22 +00:00
Merge branch 'main' of https://github.com/transloadit/uppy
* 'main' of https://github.com/transloadit/uppy: @uppy/companion: add workaround for S3 accelerated endpoints (#4140)
This commit is contained in:
commit
a3153813fa
1 changed files with 16 additions and 3 deletions
|
|
@ -20,12 +20,25 @@ module.exports = (companionOptions) => {
|
|||
throw new Error('Found unsupported `providerOptions.s3.awsClientOptions.accessKeyId` or `providerOptions.s3.awsClientOptions.secretAccessKey` configuration. Please use the `providerOptions.s3.key` and `providerOptions.s3.secret` options instead.')
|
||||
}
|
||||
|
||||
const s3ClientOptions = {
|
||||
let s3ClientOptions = {
|
||||
signatureVersion: 'v4',
|
||||
endpoint: s3.endpoint,
|
||||
region: s3.region,
|
||||
// backwards compat
|
||||
useAccelerateEndpoint: s3.useAccelerateEndpoint,
|
||||
}
|
||||
|
||||
if (s3.useAccelerateEndpoint && s3.bucket != null) {
|
||||
s3ClientOptions = {
|
||||
...s3ClientOptions,
|
||||
useAccelerateEndpoint: true,
|
||||
s3BucketEndpoint: true,
|
||||
// This is a workaround for lacking support for useAccelerateEndpoint in createPresignedPost
|
||||
// See https://github.com/transloadit/uppy/issues/4135#issuecomment-1276450023
|
||||
endpoint: `https://${s3.bucket}.s3-accelerate.amazonaws.com/`,
|
||||
}
|
||||
}
|
||||
|
||||
s3ClientOptions = {
|
||||
...s3ClientOptions,
|
||||
...rawClientOptions,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue