remove: getClientIp 로직 제거

This commit is contained in:
2025-06-30 16:13:26 +09:00
parent b5d595cb04
commit f915f8ab4b
3 changed files with 0 additions and 65 deletions
-16
View File
@@ -1,16 +0,0 @@
import { NextRequest, NextResponse } from "next/server";
export async function GET(request: NextRequest) {
const ipAddress =
request.headers.get("x-forwarded-for")?.split(",")[0] || "unknown";
const ipv4Regex = /^::ffff:(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/;
const match = ipAddress.match(ipv4Regex);
const normalizedIp = match ? match[1] : ipAddress;
return NextResponse.json({
originalIp: ipAddress,
normalizedIp: normalizedIp,
});
}