From f6b7efb1fa6ecf44d9041a6b73fcf3578267e9b5 Mon Sep 17 00:00:00 2001 From: Jan Stevens Date: Tue, 8 Mar 2022 05:29:01 +0100 Subject: [PATCH] fix: wrong replace causing "on" files on S3 (#2392) Fix the regex to only replace `.js` at the end of the string --- packages/libs/lambda-at-edge/src/regeneration-handler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/libs/lambda-at-edge/src/regeneration-handler.ts b/packages/libs/lambda-at-edge/src/regeneration-handler.ts index 933bdcfc4b..6d2b82ddac 100644 --- a/packages/libs/lambda-at-edge/src/regeneration-handler.ts +++ b/packages/libs/lambda-at-edge/src/regeneration-handler.ts @@ -31,7 +31,7 @@ export const handler = async (event: AWSLambda.SQSEvent): Promise => { const normalizedUri = decodeURI(regenerationEvent.pageS3Path) .replace(`static-pages/${manifest.buildId}`, "") - .replace(".js", ""); + .replace(/.js$/, ""); await s3StorePage({ html,