修复异步操作导致的request null,IP获取错误

2.X
TwelveT 2021-03-19 14:46:06 +08:00 committed by 疯狂的狮子li
parent 173af7702b
commit f3e9db0c0b
1 changed files with 5 additions and 0 deletions

View File

@ -14,6 +14,11 @@ public class IpUtils
{ {
public static String getIpAddr(HttpServletRequest request) public static String getIpAddr(HttpServletRequest request)
{ {
if(request == null){
return null;
}
String ip = null; String ip = null;
// X-Forwarded-ForSquid 服务代理 // X-Forwarded-ForSquid 服务代理