AlexStocks commented on code in PR #3331:
URL: https://github.com/apache/dubbo-go/pull/3331#discussion_r3278891008
##########
config_center/apollo/impl.go:
##########
@@ -224,8 +224,11 @@ func (c *apolloConfiguration)
getAddressWithProtocolPrefix(url *common.URL) stri
addrs := make([]string, 0)
for _, part := range parts {
addr := part
+ if url.Path != "" {
+ addr = strings.TrimRight(addr, "/") + "/" +
strings.TrimLeft(url.Path, "/")
Review Comment:
[P1] 这里会把仅表示“根路径”的 `url.Path == "/"` 也当成有效 context path 追加进去。这样像
`apollo://127.0.0.1:8080/` 这种输入会从原来的 `http://127.0.0.1:8080` 变成
`http://127.0.0.1:8080/`,后续再拼 Apollo 固定 endpoint 时很容易出现多余 `/`,属于边界回归。建议把全空或全
`/` 的 path 视为未设置,并补一条 trailing-slash 用例锁住行为。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]