mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Fixes https://github.com/vercel/next.js/issues/39532 ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md`
10 lines
268 B
JavaScript
10 lines
268 B
JavaScript
import { NextResponse } from 'next/server'
|
|
|
|
export function middleware(request) {
|
|
if (request.nextUrl.pathname.startsWith('/_next/')) return
|
|
|
|
const res = NextResponse.rewrite(new URL('/', request.url))
|
|
res.headers.set('X-From-Middleware', 'true')
|
|
return res
|
|
}
|