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
14 lines
302 B
TypeScript
14 lines
302 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()
|
|
}
|
|
|
|
export const config = {
|
|
matcher: ['/((?!sitemap.xml).*)'],
|
|
}
|