Files
JJ Kasper 916f105b97 Update middleware public/static matching (#78325)
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.
2025-04-18 14:01:55 -07:00

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 })
}