fix: middleware config matcher (#20450)

* fix: middleware config matcher - ending slash

* improve comment
This commit is contained in:
Benny Joo
2025-03-30 23:02:20 -03:00
committed by GitHub
parent 81de95bd28
commit 21e7ac3cbe
+12 -4
View File
@@ -174,6 +174,8 @@ function responseWithHeaders({ url, res, req }: { url: URL; res: NextResponse; r
export const config = {
// Next.js Doesn't support spread operator in config matcher, so, we must list all paths explicitly here.
// https://github.com/vercel/next.js/discussions/42458
// WARNING: DO NOT ADD AN ENDING SLASH "/" TO THE PATHS BELOW
// THIS WILL MAKE THEM NOT MATCH AND HENCE NOT HIT MIDDLEWARE
matcher: [
"/403",
"/500",
@@ -204,10 +206,16 @@ export const config = {
"/booking/:path*",
"/payment/:path*",
"/routing-forms/:path*",
"/team/:path*",
"/org/:path*",
"/:user/:type/",
"/:user/",
"/org/:orgSlug/instant-meeting/team/:slug/:type",
"/org/:orgSlug/team/:slug/:type",
"/org/:orgSlug/team/:slug",
"/org/:orgSlug/:user/:type",
"/org/:orgSlug/:user",
"/org/:orgSlug",
"/team/:slug/:type",
"/team/:slug",
"/:user/:type",
"/:user",
],
};