Upgrade app to Next.js 16
CI / quality (push) Waiting to run

This commit is contained in:
MOH
2026-03-13 15:50:37 +01:00
parent f14116b56c
commit e32ac4cacb
40 changed files with 1853 additions and 1157 deletions
+4 -4
View File
@@ -8,8 +8,8 @@ import {
type ContactProtectionSettings,
} from "@/lib/contact-protection";
function getClientIpFromHeaders() {
const requestHeaders = headers();
async function getClientIpFromHeaders() {
const requestHeaders = await headers();
const forwardedFor = requestHeaders.get("x-forwarded-for");
if (forwardedFor) {
@@ -41,7 +41,7 @@ export async function enforceContactRateLimit(settings: ContactProtectionSetting
return;
}
const ip = getClientIpFromHeaders();
const ip = await getClientIpFromHeaders();
const key = getRateLimitKey(ip, settings.rateLimit.windowMinutes);
await prisma.$transaction(async (tx) => {
@@ -87,7 +87,7 @@ export async function verifyTurnstileToken(
const body = new URLSearchParams();
body.set("secret", settings.turnstile.secretKey);
body.set("response", token);
body.set("remoteip", getClientIpFromHeaders());
body.set("remoteip", await getClientIpFromHeaders());
const response = await fetch("https://challenges.cloudflare.com/turnstile/v0/siteverify", {
method: "POST",