From 8f6844df30b1299eba1098c6bf477b74351c55ee Mon Sep 17 00:00:00 2001 From: hongawen <83944980@qq.com> Date: Tue, 28 Mar 2023 11:32:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/njcn/gateway/utils/IpUtils.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pqs-gateway/src/main/java/com/njcn/gateway/utils/IpUtils.java b/pqs-gateway/src/main/java/com/njcn/gateway/utils/IpUtils.java index 182cecbe7..5ce750bc0 100644 --- a/pqs-gateway/src/main/java/com/njcn/gateway/utils/IpUtils.java +++ b/pqs-gateway/src/main/java/com/njcn/gateway/utils/IpUtils.java @@ -45,6 +45,11 @@ public class IpUtils { public static String getRealIpAddress(ServerHttpRequest request) { HttpHeaders headers = request.getHeaders(); String ipAddress = headers.getFirst(HEADER_X_FORWARDED_FOR); + log.error("X-Forwarded-For:"+ipAddress); + ipAddress = headers.getFirst("X-Real-IP"); + log.error("X-Real-IP:"+ipAddress); + ipAddress = headers.getFirst("Proxy-Client-IP"); + log.error("Proxy-Client-IP:"+ipAddress); if (StrUtil.isBlankIfStr(ipAddress) || UNKNOWN.equalsIgnoreCase(ipAddress)) { ipAddress = headers.getFirst(HEADER_PROXY_CLIENT_IP); }