Skip to content

Commit 7cef5fe

Browse files
committed
fix: increase default locale match specificity to avoid false positives
1 parent e6b2fd1 commit 7cef5fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/runtime/src/helpers/redirects.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ const generateStaticIsrRewrites = ({
143143
return
144144
}
145145
// The default locale is served from the root, not the localised path
146-
if (i18n?.defaultLocale && route.startsWith(`/${i18n.defaultLocale}`)) {
146+
if (i18n?.defaultLocale && (route.startsWith(`/${i18n.defaultLocale}/`) || route === `/${i18n.defaultLocale}`)) {
147147
route = route.slice(i18n.defaultLocale.length + 1) || '/'
148148
staticRoutePaths.add(route)
149149
if (matchesMiddleware(middleware, route)) {

0 commit comments

Comments
 (0)