fix(middleware): hard exclude sw files in logic

This commit is contained in:
2026-01-13 13:17:30 +01:00
parent af8c442bd1
commit 88ff0131b7

View File

@@ -14,6 +14,8 @@ export function middleware(request: NextRequest) {
if (pathnameHasLocale) return; if (pathnameHasLocale) return;
if (pathname.includes("sw.js") || pathname.includes("workbox")) return NextResponse.next();
// Redirect if there is no locale // Redirect if there is no locale
const locale = defaultLocale; // For simplicity, we default to 'de' as requested const locale = defaultLocale; // For simplicity, we default to 'de' as requested
request.nextUrl.pathname = `/${locale}${pathname}`; request.nextUrl.pathname = `/${locale}${pathname}`;