Skip to content

Commit bf6baae

Browse files
committed
Ensure an empty string if env var not set
1 parent d6f7fa2 commit bf6baae

File tree

2 files changed

+2
-2
lines changed
  • api/server/services/Files/S3
  • packages/api/src/cdn

2 files changed

+2
-2
lines changed

api/server/services/Files/S3/crud.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const {
1414
const endpoint = process.env.AWS_ENDPOINT_URL;
1515
const bucketName = process.env.AWS_BUCKET_NAME;
1616
const defaultBasePath = 'images';
17-
const forcePathStyle = ['1', 'true', 'yes'].includes(process.env.AWS_FORCE_PATH_STYLE?.toLowerCase());
17+
const forcePathStyle = ['1', 'true', 'yes'].includes((process.env.AWS_FORCE_PATH_STYLE ?? '').toLowerCase());
1818

1919
let s3UrlExpirySeconds = 2 * 60; // 2 minutes
2020
let s3RefreshExpiryMs = null;

packages/api/src/cdn/s3.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const initializeS3 = (): S3Client | null => {
2828
const endpoint = process.env.AWS_ENDPOINT_URL;
2929
const accessKeyId = process.env.AWS_ACCESS_KEY_ID;
3030
const secretAccessKey = process.env.AWS_SECRET_ACCESS_KEY;
31-
const forcePathStyle = ['1', 'true', 'yes'].includes(process.env.AWS_FORCE_PATH_STYLE?.toLowerCase());
31+
const forcePathStyle = ['1', 'true', 'yes'].includes((process.env.AWS_FORCE_PATH_STYLE ?? '').toLowerCase());
3232

3333
const config = {
3434
region,

0 commit comments

Comments
 (0)