We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 192e4ec + 291d197 commit d43dc1eCopy full SHA for d43dc1e
worker/src/index.ts
@@ -10,8 +10,8 @@ export default {
10
const normalizedPath =
11
pathname === "/" ? pathname : pathname.replace(/\/$/, "");
12
13
- // Check if the path already has a version prefix (/v1/ or /v2/)
14
- const hasVersionPrefix = /^\/v[12]\//.test(normalizedPath);
+ // Check if the path already has a version prefix (/v1 or /v2)
+ const hasVersionPrefix = /^\/v[12](\/|$)/.test(normalizedPath);
15
16
// Case 1: Root path → redirect to /v2
17
if (normalizedPath === "/" || normalizedPath === "") {
0 commit comments