fix: improve getIP header resolution for CF → Vercel setup (#28152)

Co-Authored-By: unknown <>

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-02-24 14:47:14 +00:00
1 parent 9855176948
commit c9abc556ba
4 files changed
+143 -15

No files matched your search

@@ -17,11 +17,7 @@ async function handler(req: NextRequest) {
return NextResponse.json({ message: "email is required" }, { status: 400 });
}
let ip = getIP(req) ?? email.data;
const forwardedFor = req.headers.get("x-forwarded-for") as string;
if (!ip && forwardedFor) {
ip = forwardedFor?.split(",").at(0) ?? email.data;
}
const ip = getIP(req) ?? email.data;
await checkRateLimitAndThrowError({
rateLimitingType: "core",
+1 -1
View File
@@ -1,5 +1,5 @@
import { NextResponse } from "next/server";
import getIP from "@calcom/lib/getIP";
import { NextResponse } from "next/server";
export async function GET(req: Request) {
const requestorIp = getIP(req);