Skip to content

Commit 8b468ce

Browse files
hubyrodclaude
andcommitted
Exclude webhook routes from middleware to fix body stream locking
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4591e88 commit 8b468ce

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

middleware.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ export default clerkMiddleware(async (auth, request) => {
1717

1818
export const config = {
1919
matcher: [
20-
// Skip Next.js internals and static files
21-
"/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)",
20+
// Skip Next.js internals, static files, and webhook routes (body must not be consumed before the handler)
21+
"/((?!_next|github/|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)",
2222
// Always run for API routes
2323
"/(api|trpc)(.*)",
2424
],

0 commit comments

Comments
 (0)