From 44213812b87335fd064f86ebfa31f693bc21a950 Mon Sep 17 00:00:00 2001 From: YS <47836716+yszkst@users.noreply.github.com> Date: Mon, 13 Mar 2023 09:45:21 +0900 Subject: [PATCH] =?UTF-8?q?=E7=A9=BA=E6=96=87=E5=AD=97=E5=88=97=E3=81=AEob?= =?UTF-8?q?jectStorageEndtpoin=E3=82=92null=E3=81=A8=E5=90=8C=E6=A7=98?= =?UTF-8?q?=E3=81=AB=E6=89=B1=E3=81=86=20(#10312)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/core/S3Service.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/core/S3Service.ts b/packages/backend/src/core/S3Service.ts index 0ce69aaa74..cc8f950813 100644 --- a/packages/backend/src/core/S3Service.ts +++ b/packages/backend/src/core/S3Service.ts @@ -19,12 +19,14 @@ export class S3Service { @bindThis public getS3(meta: Meta) { - const u = meta.objectStorageEndpoint != null + const u = meta.objectStorageEndpoint ? `${meta.objectStorageUseSSL ? 'https://' : 'http://'}${meta.objectStorageEndpoint}` : `${meta.objectStorageUseSSL ? 'https://' : 'http://'}example.net`; - + return new S3({ - endpoint: meta.objectStorageEndpoint ?? undefined, + endpoint: meta.objectStorageEndpoint && meta.objectStorageEndpoint.length > 0 + ? meta.objectStorageEndpoint + : undefined, accessKeyId: meta.objectStorageAccessKey!, secretAccessKey: meta.objectStorageSecretKey!, region: meta.objectStorageRegion ?? undefined,