bug fixed for IPV6

This commit is contained in:
wenshao
2013-07-15 15:14:22 +08:00
parent f657c5f099
commit 9c86d3f37b
2 changed files with 9 additions and 0 deletions
@@ -287,9 +287,15 @@ public class StatViewServlet extends HttpServlet {
boolean ipV6 = remoteAddress != null && remoteAddress.indexOf(':') != -1;
if (ipV6) {
if ("0:0:0:0:0:0:0:1".equals(remoteAddress)) {
return true;
}
if (denyList.size() == 0 && allowList.size() == 0) {
return true;
}
return false;
}
IPAddress ipAddress = new IPAddress(remoteAddress);
@@ -100,6 +100,9 @@ public class StringUtils {
}
public static int lowerHashCode(String text) {
if (text == null) {
return 0;
}
// return text.toLowerCase().hashCode();
int h = 0;
for (int i = 0; i < text.length(); ++i) {