Skip to content

Commit 8252753

Browse files
committed
Merge branch 'main' into mk/matcher-slash
2 parents 747af5d + 3b83294 commit 8252753

File tree

5 files changed

+2
-1
lines changed

5 files changed

+2
-1
lines changed

packages/runtime/src/helpers/edge.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,8 @@ const getEdgeFunctionPatternForPage = ({
361361

362362
// appDir functions have a name that _isn't_ the route name, but rather the route with `/page` appended
363363
const regexp = pageRegexMap.get(appPathRoutesManifest?.[edgeFunctionDefinition.page] ?? edgeFunctionDefinition.page)
364-
return regexp ?? edgeFunctionDefinition.matchers[0].regexp
364+
// If we need to fall back to the matcher, we need to add an optional trailing slash
365+
return regexp ?? edgeFunctionDefinition.matchers[0].regexp.replace(/([^/])\$$/, '$1/?$')
365366
}
366367

367368
/**

0 commit comments

Comments
 (0)