Parcourir la source

Merge pull request #10012 from t-hikawa-satt/fix/issue-10010-s3-upload-failing

fix: S3 upload failing
Yuki Takei il y a 10 mois
Parent
commit
26e1435da0
1 fichiers modifiés avec 3 ajouts et 2 suppressions
  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
   });
   });
 };
 };