Skip to content

Commit 76160d1

Browse files
committed
修改调客户端路径(context-path)的问题
1 parent 7d102b6 commit 76160d1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

spring-cloud-gray-server/src/main/java/cn/springcloud/gray/server/module/client/DefaultClientRemoteModule.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,15 @@ public String getClientPath(String serviceId, String instanceId) {
3434
throw new IllegalArgumentException();
3535
}
3636

37-
String contextPath = grayServerModule.getServiceContextPath(serviceId);
3837
StringBuilder path = new StringBuilder("http://")
3938
.append(instanceInfo.getHost())
4039
.append(":")
41-
.append(instanceInfo.getPort())
42-
.append(contextPath);
40+
.append(instanceInfo.getPort());
41+
String contextPath = grayServerModule.getServiceContextPath(serviceId);
42+
if (StringUtils.isNotEmpty(contextPath)) {
43+
path.append("/")
44+
.append(contextPath);
45+
}
4346
return path.toString();
4447
}
4548

0 commit comments

Comments
 (0)