fix: preserve traffic api token header
All checks were successful
CI and Production Smoke / smoke (push) Successful in 7s
All checks were successful
CI and Production Smoke / smoke (push) Successful in 7s
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user