fix: preserve traffic api token header
All checks were successful
CI and Production Smoke / smoke (push) Successful in 7s

This commit is contained in:
OG T
2026-06-11 20:21:02 +08:00
parent a87b421817
commit 98acab1693

View File

@@ -15,6 +15,7 @@ export function middleware(request: NextRequest) {
const url = request.nextUrl;
const isAdminPath = url.pathname.startsWith("/admin");
const isTrafficDashboard = url.pathname === "/traffic";
const isTrafficApi = url.pathname === "/api/traffic";
const strippedHeaders = stripClientAdminHeaders(request);
if (isTrafficDashboard && process.env.NODE_ENV === "production") {
@@ -65,6 +66,10 @@ export function middleware(request: NextRequest) {
});
}
if (isTrafficApi) {
return NextResponse.next();
}
// Check if there is a referral parameter ?ref=
const ref = url.searchParams.get('ref');