IpUtils工具,清除Xss特殊字符,防止Xff注入攻击
This commit is contained in:
parent
33f09d7747
commit
19b8688759
@ -40,7 +40,7 @@ public class IpUtils
|
|||||||
{
|
{
|
||||||
ip = request.getRemoteAddr();
|
ip = request.getRemoteAddr();
|
||||||
}
|
}
|
||||||
|
ip = EscapeUtil.clean(ip);//清除Xss特殊字符
|
||||||
return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
|
return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user