Commit 19b868875992821a28f408cbbd2a31fa47f91072
Committed by
Gitee
1 parent
33f09d77
IpUtils工具,清除Xss特殊字符,防止Xff注入攻击
Showing
1 changed file
with
1 additions
and
1 deletions
ruoyi/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java
| @@ -40,7 +40,7 @@ public class IpUtils | @@ -40,7 +40,7 @@ public class IpUtils | ||
| 40 | { | 40 | { |
| 41 | ip = request.getRemoteAddr(); | 41 | ip = request.getRemoteAddr(); |
| 42 | } | 42 | } |
| 43 | - | 43 | + ip = EscapeUtil.clean(ip);//清除Xss特殊字符 |
| 44 | return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip; | 44 | return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip; |
| 45 | } | 45 | } |
| 46 | 46 |