[webapp,common]监控host参数修复校验,添加本地启动帮助
This commit is contained in:
@@ -21,7 +21,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
@Constraint(validatedBy = HostParamValidator.class)
|
||||
public @interface HostValid {
|
||||
|
||||
String message() default "Host value is invalid,must ipv4, ipv6 or domain";
|
||||
String message() default "监控Host必须是ipv4,ipv6或域名";
|
||||
|
||||
Class<?>[] groups() default {};
|
||||
|
||||
|
||||
@@ -15,10 +15,13 @@ public class IpDomainUtil {
|
||||
* 域名校验正则
|
||||
*/
|
||||
private static final Pattern DOMAIN_PATTERN =
|
||||
Pattern.compile("^([hH][tT]{2}[pP]://|[hH][tT]{2}[pP][sS]://)?(([A-Za-z0-9-~]+).)+([A-Za-z0-9-~\\/])+$");
|
||||
Pattern.compile("^(?=^.{3,255}$)[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+$");
|
||||
|
||||
private static final String LOCALHOST = "localhost";
|
||||
|
||||
/**
|
||||
* HTTP协议头校验规则
|
||||
*/
|
||||
private static final Pattern DOMAIN_SCHEMA = Pattern.compile("^([hH][tT]{2}[pP]://|[hH][tT]{2}[pP][sS]://){1}[^\\s]*");
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user