mirror of
https://gitee.com/log4j/pig.git
synced 2025-01-03 23:42:22 +08:00
!223 update 使用 apache 网络工具 替换 sun 工具 兼容jdk11处理
Merge pull request !223 from 疯狂的狮子Li/N/A
This commit is contained in:
commit
7bac3d9702
@ -20,6 +20,7 @@ import com.alibaba.csp.sentinel.util.StringUtil;
|
|||||||
|
|
||||||
import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo;
|
import com.alibaba.csp.sentinel.dashboard.discovery.MachineInfo;
|
||||||
import com.alibaba.csp.sentinel.dashboard.domain.Result;
|
import com.alibaba.csp.sentinel.dashboard.domain.Result;
|
||||||
|
import org.apache.http.conn.util.InetAddressUtils;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -50,7 +51,9 @@ public class MachineRegistryController {
|
|||||||
if (StringUtil.isBlank(ip) || ip.length() > 128) {
|
if (StringUtil.isBlank(ip) || ip.length() > 128) {
|
||||||
return Result.ofFail(-1, "invalid ip: " + ip);
|
return Result.ofFail(-1, "invalid ip: " + ip);
|
||||||
}
|
}
|
||||||
|
if (!InetAddressUtils.isIPv4Address(ip) && !InetAddressUtils.isIPv6Address(ip)) {
|
||||||
|
return Result.ofFail(-1, "invalid ip: " + ip);
|
||||||
|
}
|
||||||
if (port == null || port < -1) {
|
if (port == null || port < -1) {
|
||||||
return Result.ofFail(-1, "invalid port");
|
return Result.ofFail(-1, "invalid port");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user