mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
This alters the behavior of the subrequest check to allow for 5 recursive calls to match Vercel production, ref [Slack thread](https://pinglabsworkspace.slack.com/archives/C052S77L05C/p1694729495655489). > [!NOTE] > Currently limited by fetches having to forward the subrequest header for each request which isn't ideal. Need some assistant on how to access the request in the module context fetch override. > No forwarding:  > With forwarding:  --------- Co-authored-by: JJ Kasper <[email protected]>
12 lines
229 B
TypeScript
12 lines
229 B
TypeScript
import { NextRequest, NextResponse } from 'next/server'
|
|
|
|
export const runtime = 'edge'
|
|
|
|
let count = 0
|
|
|
|
export const GET = async (req: NextRequest) => {
|
|
await fetch(req.nextUrl)
|
|
count++
|
|
return NextResponse.json({ count })
|
|
}
|