Skip to content

Commit

Permalink
fix: Add file extention check into single middleware matcher. (#3870)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryan-robitaille authored Jun 20, 2024
1 parent 4f0bad4 commit f4b92bc
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,17 @@ const { auth } = NextAuth({
});

export const config = {
matcher: [
//Match all request paths except for ones that reference files with a file extension
"/((?!.*\\.[^/]+?$).*)",
/*
/*
Match all request paths except for the ones starting with:
- _next/static (static files)
- _next/image (image optimization files)
- img (public image files)
- static (public static files)
- react_devtools (React DevTools)
- contain files with extentions
*/

"/((?!_next/static|_next/image|img|static|react_devtools|unsupported-browser|javascript-disabled|__nextjs_).*)",
],
matcher:
"/((?!_next/static|_next/image|img|static|react_devtools|unsupported-browser|javascript-disabled|__nextjs_|.*\\.[^/]+?$).*)",
};

// TOMORROW
Expand Down

0 comments on commit f4b92bc

Please sign in to comment.