From 8a91587ae2fd049e6ec2c6a06f8831d55d9f7675 Mon Sep 17 00:00:00 2001 From: HuangXin Date: Wed, 20 Jan 2021 17:08:49 +0800 Subject: [PATCH] =?UTF-8?q?OCT=20REM:=201.=20=E6=9B=B4=E6=96=B0=E8=BF=AA?= =?UTF-8?q?=E6=99=AE=E8=AE=BE=E5=A4=87IP=E6=AE=B5=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dispose/ability/impl/DpTechBypassAbilityImpl.java | 9 +++++---- src/main/java/com/dispose/common/ConstValue.java | 7 ++++++- 2 files changed, 11 insertions(+), 5 deletions(-) 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. *