Skip to content
Permalink
Browse files
修复更新,删除service类型的条件路由异常的问题 (#861)
  • Loading branch information
ymybxx committed Dec 24, 2021
1 parent bc280e5 commit df24d399cc309e21f411ef8aebb8dc5606bc275c
Showing 1 changed file with 2 additions and 0 deletions.
@@ -77,6 +77,7 @@ public void updateConditionRoute(ConditionRouteDTO newConditionRoute) {
//for 2.6
if (StringUtils.isNotEmpty(newConditionRoute.getService())) {
for (Route old : convertRouteToOldRoute(oldConditionRoute)) {
old.setService(id);
registry.unregister(old.toUrl().addParameter(Constants.COMPATIBLE_CONFIG, true));
}
for (Route updated : convertRouteToOldRoute(newConditionRoute)) {
@@ -101,6 +102,7 @@ public void deleteConditionRoute(String id) {
RoutingRule originRule = YamlParser.loadObject(config, RoutingRule.class);
ConditionRouteDTO conditionRouteDTO = RouteUtils.createConditionRouteFromRule(originRule);
for (Route old : convertRouteToOldRoute(conditionRouteDTO)) {
old.setService(id);
URL oldUrl = old.toUrl();
if(oldUrl.getParameter("rule").contains("host") && oldUrl.getParameter("rule").contains("false")) {
registry.unregister(oldUrl);

0 comments on commit df24d39

Please sign in to comment.