mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
fix(core): s3 region fallback (#4049)
Signed-off-by: Danil Tankov <danil.tankoff@yandex.ru>
This commit is contained in:
parent
160f861800
commit
2d7c0aa3c3
1 changed files with 1 additions and 5 deletions
|
@ -9,11 +9,7 @@ export const buildS3Storage = (
|
|||
secretAccessKey: string
|
||||
) => {
|
||||
// Endpoint example: s3.us-west-2.amazonaws.com
|
||||
const region = /s3\.([^.]*)\.amazonaws/.exec(endpoint)?.[1];
|
||||
|
||||
if (!region) {
|
||||
throw new Error('Invalid S3 endpoint, can not find region');
|
||||
}
|
||||
const region = /s3\.([^.]*)\.amazonaws/.exec(endpoint)?.[1] ?? 'us-east-1';
|
||||
|
||||
const client = new S3Client({
|
||||
region,
|
||||
|
|
Loading…
Reference in a new issue