Skip to content

Commit

Permalink
Fix url merge, merge attributes (apache#2503)
Browse files Browse the repository at this point in the history
  • Loading branch information
chickenlj authored Nov 14, 2023
1 parent 5466eb0 commit 0992795
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions common/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0992795

Please sign in to comment.