Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
fix(docs): Move x-pathname header to proxy.ts, remove middleware.ts
Next.js 16 doesn't allow both middleware.ts and proxy.ts. Set x-pathname header in the existing proxy.ts instead. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
sohamganatra committed
Jan 28, 2026 at 16:48 UTC
74601305b76e79207f77e6e68745a6125d311303
2 files changed
+3
-15
docs/middleware.ts
deleted
-14
@@ -1,14 +0,0 @@
1
-import { NextResponse } from 'next/server';
2
-import type { NextRequest } from 'next/server';
3
-
4
-export function middleware(request: NextRequest) {
5
- const response = NextResponse.next();
6
- response.headers.set('x-pathname', request.nextUrl.pathname);
7
- return response;
8
-}
9
-
10
-export const config = {
11
- matcher: [
12
- '/((?!_next/static|_next/image|favicon.ico|icon.png|apple-icon.png).*)',
13
- ],
14
-};
docs/proxy.ts
+3
-1
@@ -42,7 +42,9 @@ export function proxy(request: NextRequest) {
42
}
43
}
44
45
- return NextResponse.next();
45
+ const response = NextResponse.next();
46
+ response.headers.set('x-pathname', pathname);
47
+ return response;
48
}
49
50
export const config = {