Cloudflare 프록시 환경의 관리자 IP 판별 보정

This commit is contained in:
DESKTOP-KSVGT20\shkim
2026-05-18 02:00:38 +09:00
parent 5cb2919e84
commit 8aec7abd01
+3
View File
@@ -225,6 +225,9 @@ function normalizeIp(value) {
}
function clientIp(req) {
const cloudflareIp = normalizeIp(req.get("cf-connecting-ip") || "");
if (cloudflareIp) return cloudflareIp;
const forwarded = String(req.get("x-forwarded-for") || "")
.split(",")
.map(normalizeIp)