fix: ignore static assets in locale middleware matcher

This commit is contained in:
MichalC
2026-08-31 22:40:07 +02:00
parent 5a9128e2f5
commit d728108b3e
+4
View File
@@ -5,6 +5,10 @@ import { i18n } from './i18n.config';
const localeMiddleware = createLocaleMiddleware({ config: i18n });
export const config = {
matcher: ['/((?!api|admin|_next|.*\\..*).*)'],
};
export default function proxy(req: NextRequest) {
const r = localeMiddleware(req);
const res = r.type === 'next' ? NextResponse.next() : NextResponse.redirect(new URL(r.location, req.url));