Skip to content

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

sohamganatra74601305b76e
diff --git a/docs/middleware.ts b/docs/middleware.ts
deleted file mode 100644
index a43a5df81..000000000
--- a/docs/middleware.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NextResponse } from 'next/server';
-import type { NextRequest } from 'next/server';
-
-export function middleware(request: NextRequest) {
- const response = NextResponse.next();
- response.headers.set('x-pathname', request.nextUrl.pathname);
- return response;
-}
-
-export const config = {
- matcher: [
- '/((?!_next/static|_next/image|favicon.ico|icon.png|apple-icon.png).*)',
- ],
-};
diff --git a/docs/proxy.ts b/docs/proxy.ts
index 74cd6e99a..a114b7ab7 100644
--- a/docs/proxy.ts
+++ b/docs/proxy.ts
@@ -42,7 +42,9 @@ export function proxy(request: NextRequest) {
}
}
- return NextResponse.next();
+ const response = NextResponse.next();
+ response.headers.set('x-pathname', pathname);
+ return response;
}
export const config = {