-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
When s3's api is not provided by AWS(say, googlecloud, azure), an error would happen. because the endpoint-url is overwrited by the region conditional judgment:
Lines 51 to 57 in a41c4db
| let s3Endpoint = 's3.amazonaws.com' | |
| if (config.s3.endpoint) { | |
| s3Endpoint = config.s3.endpoint | |
| } else if (config.s3.region && config.s3.region !== 'us-east-1') { | |
| s3Endpoint = `s3-${config.s3.region}.amazonaws.com` | |
| } | |
| callback(null, `https://${s3Endpoint}/${config.s3bucket}/${params.Key}`) |
my suggest code to fix this bug:
let s3Endpoint = 's3.amazonaws.com'
if (config.s3.region && config.s3.region !== 'us-east-1') {
s3Endpoint = `s3-${config.s3.region}.amazonaws.com`
}
if (config.s3.endpoint) {
s3Endpoint = config.s3.endpoint
} jdzhuang
Metadata
Metadata
Assignees
Labels
No labels