Skip to content

🎥 Make videos programmatically with React

allow semicolon in s3 keys

Alex Fernandez3beda19cbfcf
diff --git a/packages/lambda/src/shared/validate-outname.ts b/packages/lambda/src/shared/validate-outname.ts
index 1f52240e00..9c8fdb20f4 100644
--- a/packages/lambda/src/shared/validate-outname.ts
+++ b/packages/lambda/src/shared/validate-outname.ts
@@ -10,9 +10,9 @@ const validateS3Key = (s3Key: string) => {
);
}
- if (!s3Key.match(/^([0-9a-zA-Z-!_.*'()/]+)$/g)) {
+ if (!s3Key.match(/^([0-9a-zA-Z-!_.*'()/:]+)$/g)) {
throw new Error(
- "The S3 Key must match the RegExp `/([0-9a-zA-Z-!_.*'()/]+)/g`. You passed: " +
+ "The S3 Key must match the RegExp `/([0-9a-zA-Z-!_.*'()/:]+)/g`. You passed: " +
s3Key +
'. Check for invalid characters.'
);
diff --git a/packages/lambda/src/test/unit/expected-out-name.test.ts b/packages/lambda/src/test/unit/expected-out-name.test.ts
index d0dc27ba0a..19fe04012d 100644
--- a/packages/lambda/src/test/unit/expected-out-name.test.ts
+++ b/packages/lambda/src/test/unit/expected-out-name.test.ts
@@ -113,3 +113,18 @@ test('Should allow outName an outname with a slash', () => {
renderBucketName: 'remotionlambda-98fsduf',
});
});
+
+test('Should allow outName an outname with colon', () => {
+ const newRenderMetadata: RenderMetadata = {
+ ...testRenderMetadata,
+ codec: null,
+ audioCodec: null,
+ type: 'still',
+ outName: 'ap-east-1:xxxxxx/video/XXXXX-0b9ba84XXXX.mp4',
+ };
+ expect(getExpectedOutName(newRenderMetadata, bucketName, null)).toEqual({
+ customCredentials: null,
+ key: 'renders/9n8dsfafs/ap-east-1:xxxxxx/video/XXXXX-0b9ba84XXXX.mp4',
+ renderBucketName: 'remotionlambda-98fsduf',
+ });
+});
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 853a3d1d54..633c78e44a 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -12305,8 +12305,8 @@ packages:
engines: {node: '>=10'}
hasBin: true
dependencies:
- is-text-path: 1.0.1
JSONStream: 1.3.5
+ is-text-path: 1.0.1
lodash: 4.17.21
meow: 8.1.2
split2: 3.2.2