diff --git a/src/config.ts b/src/config.ts index bac846fb..78a0a640 100644 --- a/src/config.ts +++ b/src/config.ts @@ -107,6 +107,7 @@ type StorageConfigType = { tusPath: string tusPartSize: number tusUseFileVersionSeparator: boolean + tusAllowS3Tags: boolean defaultMetricsEnabled: boolean s3ProtocolEnabled: boolean s3ProtocolPrefix: string @@ -251,6 +252,7 @@ export function getConfig(options?: { reload?: boolean }): StorageConfigType { ), tusUseFileVersionSeparator: getOptionalConfigFromEnv('TUS_USE_FILE_VERSION_SEPARATOR') === 'true', + tusAllowS3Tags: getOptionalConfigFromEnv('TUS_ALLOW_S3_TAGS') !== 'false', // S3 Protocol s3ProtocolEnabled: getOptionalConfigFromEnv('S3_PROTOCOL_ENABLED') !== 'false', diff --git a/src/http/routes/tus/index.ts b/src/http/routes/tus/index.ts index 4e91f009..510ffd59 100644 --- a/src/http/routes/tus/index.ts +++ b/src/http/routes/tus/index.ts @@ -42,6 +42,7 @@ const { tusPath, tusPartSize, tusMaxConcurrentUploads, + tusAllowS3Tags, uploadFileSizeLimit, storageBackendType, storageFilePath, @@ -66,6 +67,7 @@ function createTusStore(agent: { httpsAgent: https.Agent; httpAgent: http.Agent expirationPeriodInMilliseconds: tusUrlExpiryMs, cache: new AlsMemoryKV(), maxConcurrentPartUploads: tusMaxConcurrentUploads, + useTags: tusAllowS3Tags, s3ClientConfig: { requestHandler: new NodeHttpHandler({ ...agent,