fix: ignore static assets in locale middleware matcher
This commit is contained in:
@@ -5,6 +5,10 @@ import { i18n } from './i18n.config';
|
|||||||
|
|
||||||
const localeMiddleware = createLocaleMiddleware({ config: i18n });
|
const localeMiddleware = createLocaleMiddleware({ config: i18n });
|
||||||
|
|
||||||
|
export const config = {
|
||||||
|
matcher: ['/((?!api|admin|_next|.*\\..*).*)'],
|
||||||
|
};
|
||||||
|
|
||||||
export default function proxy(req: NextRequest) {
|
export default function proxy(req: NextRequest) {
|
||||||
const r = localeMiddleware(req);
|
const r = localeMiddleware(req);
|
||||||
const res = r.type === 'next' ? NextResponse.next() : NextResponse.redirect(new URL(r.location, req.url));
|
const res = r.type === 'next' ? NextResponse.next() : NextResponse.redirect(new URL(r.location, req.url));
|
||||||
|
|||||||
Reference in New Issue
Block a user