This is an automated email from the ASF dual-hosted git repository. liujun pushed a commit to branch feature-triple in repository https://gitbox.apache.org/repos/asf/dubbo-go.git
The following commit(s) were added to refs/heads/feature-triple by this push: new 099279537 Fix url merge, merge attributes (#2503) 099279537 is described below commit 099279537adf69e325b337407b8e3178a35f16a6 Author: Ken Liu <ken.lj...@gmail.com> AuthorDate: Tue Nov 14 15:16:20 2023 +0800 Fix url merge, merge attributes (#2503) --- common/url.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/url.go b/common/url.go index f00cf664e..e98543390 100644 --- a/common/url.go +++ b/common/url.go @@ -818,6 +818,14 @@ func MergeURL(serviceURL *URL, referenceURL *URL) *URL { mergedURL.Methods[i] = method } } + + // merge attributes + if mergedURL.attributes == nil { + mergedURL.attributes = make(map[string]interface{}, len(referenceURL.attributes)) + } + for attrK, attrV := range referenceURL.attributes { + mergedURL.attributes[attrK] = attrV + } // In this way, we will raise some performance. mergedURL.ReplaceParams(params) return mergedURL