IpUtils工具,清除Xss特殊字符,防止Xff注入攻击

This commit is contained in:
Live 2020-06-09 11:36:10 +08:00 committed by Gitee
parent 33f09d7747
commit 19b8688759

View File

@ -40,7 +40,7 @@ public class IpUtils
{
ip = request.getRemoteAddr();
}
ip = EscapeUtil.clean(ip);//清除Xss特殊字符
return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
}