From 20ca75fab316154de4caed8723aa49f14bfa9acc Mon Sep 17 00:00:00 2001 From: emily-shen <69125074+emily-shen@users.noreply.github.com> Date: Tue, 10 Sep 2024 17:16:53 +0100 Subject: [PATCH] add comments to explain routing logic --- packages/wrangler/src/deploy/deploy.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/wrangler/src/deploy/deploy.ts b/packages/wrangler/src/deploy/deploy.ts index 1c4506b72334..9a7b14f4431e 100644 --- a/packages/wrangler/src/deploy/deploy.ts +++ b/packages/wrangler/src/deploy/deploy.ts @@ -192,13 +192,16 @@ export const validateRoutes = ( const components = pattern.split("/"); if ( + // = ["route.com"] bare domains are invalid as it would only match exactly that components.length === 1 || + // = ["route.com",""] as above (components.length === 2 && components[1] === "") ) { invalidRoutes[pattern] ??= []; invalidRoutes[pattern].push( `Workers which have static assets must end with a wildcard path. Update the route to end with /*` ); + // ie it doesn't match exactly "route.com/*" = [route.com, *] } else if (!(components.length === 2 && components[1] === "*")) { invalidRoutes[pattern] ??= []; invalidRoutes[pattern].push(