Files
Niklas MischkulnigandGitHub a6d950a445 Turbopack: fix static asset skew protection for edge and prerenders (#90238)
- Edge Runtime was missing `globalThis.NEXT_CLIENT_ASSET_SUFFIX` at runtime
- Prerenders were always running `globalThis.NEXT_CLIENT_ASSET_SUFFIX` set

Fixups after #88828
2026-02-20 18:31:02 +01:00

14 lines
389 B
TypeScript

import { NextRequest, NextResponse } from 'next/server'
// @ts-ignore
import imported from './public/vercel.png'
const url = new URL('./public/vercel.png', import.meta.url).toString()
export async function middleware(req: NextRequest) {
if (req.nextUrl.toString().endsWith('/middleware')) {
return Response.json({ imported: imported.src, url })
}
return NextResponse.next()
}