From 2a1d4624084e8cf62ff9283d0e304cc95fcdab48 Mon Sep 17 00:00:00 2001 From: ahaoyao <129247228+ahaoyao@users.noreply.github.com> Date: Fri, 7 Jul 2023 15:07:22 +0800 Subject: [PATCH] The dss prod label interface forwarding problem was fixed. (#4746) --- .../apache/linkis/gateway/dss/parser/DSSGatewayParser.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-server-support/src/main/scala/org/apache/linkis/gateway/dss/parser/DSSGatewayParser.scala b/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-server-support/src/main/scala/org/apache/linkis/gateway/dss/parser/DSSGatewayParser.scala index bdf8dfbe5f..5fbe7b20d6 100644 --- a/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-server-support/src/main/scala/org/apache/linkis/gateway/dss/parser/DSSGatewayParser.scala +++ b/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-server-support/src/main/scala/org/apache/linkis/gateway/dss/parser/DSSGatewayParser.scala @@ -238,8 +238,10 @@ class DSSGatewayParser extends AbstractGatewayParser { retService } } - val lowerServiceId = parsedServiceId.toLowerCase(Locale.getDefault()) + var lowerServiceId = parsedServiceId.toLowerCase(Locale.getDefault()) val serverName = tmpServerName.toLowerCase(Locale.getDefault()) + // 让prod的接口匹配到prod的服务 + if (serverName.endsWith("-prod")) lowerServiceId += "/prod" findIt(_.toLowerCase(Locale.getDefault()) == serverName).orElse(findMostCorrect(service => { (service, lowerServiceId.split("/").count(word => service.contains(word))) }))