mirror of
https://github.com/luckyyzh/pi-agent-integrated.git
synced 2026-10-03 02:59:35 +00:00
12 lines
380 B
TypeScript
12 lines
380 B
TypeScript
import { NextResponse, type NextRequest } from "next/server";
|
|
import { isApiRequestAllowed } from "@/lib/request-security";
|
|
|
|
export function proxy(request: NextRequest) {
|
|
if (!isApiRequestAllowed(request)) {
|
|
return NextResponse.json({ error: "Untrusted API request" }, { status: 403 });
|
|
}
|
|
return NextResponse.next();
|
|
}
|
|
|
|
export const config = { matcher: "/api/:path*" };
|