mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
Add test to confirm that the middleware affects the sitemap path if the matcher is misconfigured. Following of https://github.com/vercel/next.js/pull/69136 Closes NDX-221
10 lines
238 B
TypeScript
10 lines
238 B
TypeScript
import { NextResponse } from 'next/server'
|
|
|
|
export default function (request) {
|
|
if (request.nextUrl.pathname !== '/redirected') {
|
|
return NextResponse.redirect(new URL('/redirected', request.url))
|
|
}
|
|
|
|
return NextResponse.next()
|
|
}
|