This is an automated email from the ASF dual-hosted git repository.

alexstocks pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/3.0 by this push:
     new e376834  fix: location trim space (#1306) (#1670)
e376834 is described below

commit e3768344ecb0d22ac22b7e530070f5c15c1c4e40
Author: LeonXu <[email protected]>
AuthorDate: Sat Dec 18 19:53:23 2021 +0800

    fix: location trim space (#1306) (#1670)
---
 common/url.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/url.go b/common/url.go
index e65c749..a800a30 100644
--- a/common/url.go
+++ b/common/url.go
@@ -267,6 +267,7 @@ func NewURL(urlString string, opts ...Option) (*URL, error) 
{
        s.Location = serviceURL.Host
        s.Path = serviceURL.Path
        for _, location := range strings.Split(s.Location, ",") {
+               location = strings.Trim(location, " ")
                if strings.Contains(location, ":") {
                        s.Ip, s.Port, err = net.SplitHostPort(location)
                        if err != nil {

Reply via email to