Browse Source

Merge branch 'master' into feat/enhanced-access-token

Shun Miyazawa 10 months ago
parent
commit
22fd3eca9d
1 changed files with 3 additions and 2 deletions
  1. 3 2
      apps/app/src/server/service/file-uploader/aws/index.ts

+ 3 - 2
apps/app/src/server/service/file-uploader/aws/index.ts

@@ -86,6 +86,7 @@ const getS3Bucket = (): string | undefined => {
 const S3Factory = (): S3Client => {
 const S3Factory = (): S3Client => {
   const accessKeyId = configManager.getConfig('aws:s3AccessKeyId');
   const accessKeyId = configManager.getConfig('aws:s3AccessKeyId');
   const secretAccessKey = configManager.getConfig('aws:s3SecretAccessKey');
   const secretAccessKey = configManager.getConfig('aws:s3SecretAccessKey');
+  const s3CustomEndpoint = configManager.getConfig('aws:s3CustomEndpoint') || undefined;
 
 
   return new S3Client({
   return new S3Client({
     credentials: accessKeyId != null && secretAccessKey != null
     credentials: accessKeyId != null && secretAccessKey != null
@@ -95,8 +96,8 @@ const S3Factory = (): S3Client => {
       }
       }
       : undefined,
       : undefined,
     region: configManager.getConfig('aws:s3Region'),
     region: configManager.getConfig('aws:s3Region'),
-    endpoint: configManager.getConfig('aws:s3CustomEndpoint'),
-    forcePathStyle: configManager.getConfig('aws:s3CustomEndpoint') != null, // s3ForcePathStyle renamed to forcePathStyle in v3
+    endpoint: s3CustomEndpoint,
+    forcePathStyle: !!s3CustomEndpoint, // s3ForcePathStyle renamed to forcePathStyle in v3
   });
   });
 };
 };