diff --git a/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java b/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java index 90a29c68..22925006 100644 --- a/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java +++ b/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java @@ -243,11 +243,12 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl { * @return the traction strategy format */ private String getIpSegmentFormat(String ipSegment) { - if (!ipSegment.contains("/") && !ipSegment.contains("-")) { - return ipSegment + "-" + ipSegment; - } else { - return ipSegment; + for (String v : ConstValue.IP_SEGMENT_SPILT) { + if (ipSegment.contains(v)) { + return ipSegment; + } } + return ipSegment + "-" + ipSegment; } /** diff --git a/src/main/java/com/dispose/common/ConstValue.java b/src/main/java/com/dispose/common/ConstValue.java index 38c3ae18..fe3daa9c 100644 --- a/src/main/java/com/dispose/common/ConstValue.java +++ b/src/main/java/com/dispose/common/ConstValue.java @@ -85,10 +85,15 @@ public class ConstValue { public static final String BUSINESS_TYPE = "^(GENERAL)|(WEB)|(DNS)|(GAME)$"; /** - * The constant NUM_TYPE. + * The constant NUMBER_TYPE. */ public static final String NUMBER_TYPE = "^[0-9]+([.]{1}[0-9]+){0,1}$"; + /** + * The constant IP_SEGMENT_SPILT. + */ + public static final String[] IP_SEGMENT_SPILT = new String[] {"-", "/"}; + /** * The type Protocol. *