From 099279537adf69e325b337407b8e3178a35f16a6 Mon Sep 17 00:00:00 2001 From: Ken Liu Date: Tue, 14 Nov 2023 15:16:20 +0800 Subject: [PATCH] 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 f00cf664ef..e985433901 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