From 3628484feb16a658c3c19dbc30f3af5ab2787139 Mon Sep 17 00:00:00 2001 From: Daniel Van Der Ploeg Date: Mon, 20 May 2024 10:54:13 +0930 Subject: [PATCH] fix: ignore wildcards at end of path --- packages/static-hosting/lib/static-hosting.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/static-hosting/lib/static-hosting.ts b/packages/static-hosting/lib/static-hosting.ts index 55db30c8..e4386039 100644 --- a/packages/static-hosting/lib/static-hosting.ts +++ b/packages/static-hosting/lib/static-hosting.ts @@ -503,7 +503,8 @@ export class StaticHosting extends Construct { } as Behavior; // If the remap is to a different path, create a Lambda@Edge function to handle this - if (from !== to) { + // Ignore wildcards at the end of a path + if (from.replace(/\*$/, '') !== to) { // Remove special characters from path const id = from.replace(/[&/\\#,+()$~%'":*?<>{}]/g, "-");