From 30512db8f6e4c44faacde06546f7016a739d66fd Mon Sep 17 00:00:00 2001 From: Chris Park Date: Thu, 23 May 2024 13:51:34 +0930 Subject: [PATCH] DO-1661: let parameter presence evaluated first --- packages/static-hosting/lib/static-hosting.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/static-hosting/lib/static-hosting.ts b/packages/static-hosting/lib/static-hosting.ts index 19323e01..b18e6454 100644 --- a/packages/static-hosting/lib/static-hosting.ts +++ b/packages/static-hosting/lib/static-hosting.ts @@ -617,7 +617,7 @@ export class StaticHosting extends Construct { // If the remap is to a different path, create a Lambda@Edge function to handle this // Remove special characters from path - if (from.replace(/\*$/, "") !== to && to) { + if (to && from.replace(/\*$/, "") !== to) { const id = from.replace(/[&/\\#,+()$~%'":*?<>{}]/g, "-"); const remapFunction = new PathRemapFunction(