NeverENG commented on code in PR #3331:
URL: https://github.com/apache/dubbo-go/pull/3331#discussion_r3272762130


##########
config_center/apollo/impl_test.go:
##########
@@ -201,6 +201,39 @@ func initMockApollo(t *testing.T) *apolloConfiguration {
        return configuration
 }
 
+func TestGetAddressWithProtocolPrefix(t *testing.T) {
+       tests := []struct {
+               name    string
+               rawURL  string
+               want    string
+       }{
+               {
+                       name:   "with context path",
+                       rawURL: "apollo://127.0.0.1:8080/config",
+                       want:   "http://127.0.0.1:8080/config";,
+               },
+               {
+                       name:   "without context path",
+                       rawURL: "apollo://127.0.0.1:8080",
+                       want:   "http://127.0.0.1:8080";,
+               },
+               {
+                       name:   "multiple addresses with context path",
+                       rawURL: 
"apollo://127.0.0.1:8080,192.168.1.1:8080/config",
+                       want:   
"http://127.0.0.1:8080/config,http://192.168.1.1:8080/config";,

Review Comment:
   common.URL 
只能解析最后一个path,虽然apollo这边集群只需要一个path(注册中心的多地址场景,path和context_path是一致的),就比如输入apollo://127.0.01:8080,133.3.3.4:8080,123.123.123.123:8080/config,所有的地址都是公用一个contextpath,如果要支持每一个Url都能单独配置path的话,最好要改URL那边的逻辑(apollo这里还用不到),需要我提一个issue吗



-- 
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]

Reply via email to