Skip to content

Commit 04ddbdd

Browse files
committed
fix regex (non-greedy)
1 parent ea536c9 commit 04ddbdd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/astro/src/server/middleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ export function interpolateRouteFromUrlAndParams(
341341
})
342342
.join('/')
343343
// Remove trailing slash (only if it's not the only segment)
344-
.replace(/(.+)\/$/, '$1')
344+
.replace(/^(.+?)\/$/, '$1')
345345
);
346346
}
347347

0 commit comments

Comments
 (0)