fix(s3): replace dash with dot for s3 endpoint

According to the AWS documentation there is no situation that there is a dash in `s3-<region>.amazonaws.com`, the correct way is with a dot `s3.<region>.amazonaws.com`
Source: https://docs.aws.amazon.com/general/latest/gr/s3.html

Signed-off-by: Matej Cotman <matej.cotman@eficode.com>
This commit is contained in:
Matej Cotman 2021-08-04 16:04:07 +03:00
parent 8ab173e994
commit 65fac143f6

View file

@ -46,7 +46,7 @@ exports.uploadImage = function (imagePath, callback) {
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`
s3Endpoint = `s3.${config.s3.region}.amazonaws.com`
}
callback(null, `https://${s3Endpoint}/${config.s3bucket}/${params.Key}`)
})