修改拦截策略配置导入模板;修正http(s) 重定向配置导入校验

This commit is contained in:
zhangwenqing
2019-01-08 10:08:33 +08:00
parent 0bbb751020
commit 2c0ab8687b
8 changed files with 133 additions and 46 deletions

View File

@@ -2340,10 +2340,11 @@ public abstract class BaseService {
umap.put("pps_threadshold", _cfg.getPpsThreadshold());
maatCfg.setUserRegion(new Gson().toJson(umap));
}else if(regionDict.getFunctionId()==200) {// IP Intercept
maatCfg.setUserRegion(Constants.USER_REGION_PLACEHOLDER);
/*maatCfg.setUserRegion(Constants.USER_REGION_PLACEHOLDER);
if(_cfg.getAction().equals(Constants.MONIT_ACTION)) {
maatCfg.setUserRegion(Constants.INTERCEPT_IP_MONIT_USER_REGION_KEY+"="+Constants.USER_REGION_PLACEHOLDER);
}
}*/
maatCfg.setUserRegion(Constants.INTERCEPT_IP_RATELIMIT_DROPRATE_USER_REGION_KEY+"="+_cfg.getUserRegion2());
}else if(regionDict.getFunctionId()==207 || regionDict.getFunctionId()==208 || regionDict.getFunctionId()==209) {// HTTP(s)阻断、重定向、替换
String userRegion = Constants.USER_REGION_PLACEHOLDER;
if(_cfg.getAction().equals(Constants.REJECT_ACTION)) {// 阻断
@@ -2448,7 +2449,7 @@ public abstract class BaseService {
}
}else if(regionDict.getDictId()==159) {
maatCfg.setUserRegion(Constants.P2P_HASH_TYPE_USER_REGION_KEY+"="+_cfg.getUserRegion1());
}else if(regionDict.getFunctionId()==201) {// Domain Intercept
}else if(regionDict.getFunctionId()==200) {// Domain Intercept
String userRegion = Constants.USERREGION_DOMAIN_ID+"="+_cfg.getCompileId()+";"+Constants.USERREGION_DOMAIN_STR+"="+_cfg.getCfgKeywords();
if(_cfg.getAction().equals(Constants.MONIT_ACTION)) {// 监测 需要发keyring_id、拦截强度
userRegion = Constants.INTERCEPT_IP_MONIT_USER_REGION_KEY+"=0"+";"+Constants.INTERCEPT_DOMAN_INTENSITY_USER_REGION_KEY+"="+_cfg.getUserRegion5()+";" + userRegion;