Initial commit: fristy.net personal site
Build & Push / Lint & Build (push) Failing after 1m23s
Build & Push / Build & Push Image (push) Skipped

This commit is contained in:
fristy committed 2026-09-10 04:27:38 +03:00
commit bab59de461
51 files changed
+6033

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
import { NextResponse } from "next/server";
import type { NextRequest } from "next/server";
import { LOCALE_COOKIE, matchLocale } from "./lib/i18n/locales";
export function proxy(request: NextRequest) {
if (request.cookies.has(LOCALE_COOKIE)) {
return NextResponse.next();
}
const locale = matchLocale(request.headers.get("accept-language"));
const response = NextResponse.next();
response.cookies.set(LOCALE_COOKIE, locale, {
path: "/",
maxAge: 60 * 60 * 24 * 365,
sameSite: "lax",
});
return response;
}
export const config = {
matcher: [
"/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp|ico)).*)",
],
};