mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
916f105b97
This updates our matcher handling for middleware to ensure we check encoded/decoded versions of the pathname since the regex will most often not handle all encoding variations. This matcher change only affects public/static files as pages/API routes doesn't allow mismatching encoding.
21 lines
425 B
JavaScript
21 lines
425 B
JavaScript
import { NextResponse } from 'next/server'
|
|
|
|
export const config = {
|
|
matcher: [
|
|
'/file.svg',
|
|
'/vercel copy.svg',
|
|
'/another/file.svg',
|
|
'/another/hello',
|
|
'/dynamic/:path*',
|
|
'/glob/:path*',
|
|
'/pages-another/hello',
|
|
'/pages-dynamic/:path*',
|
|
'/pages-glob/:path*',
|
|
'/_next/static/css/:path*',
|
|
],
|
|
}
|
|
|
|
export default function middleware() {
|
|
return NextResponse.json({ middleware: true })
|
|
}
|