File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,8 @@ func (f *FileAuthProvider) init() {
122122
123123// LookupAddr looks up a given domain/address and returns appropriate auth strategy
124124func (f * FileAuthProvider ) LookupAddr (addr string ) []authx.AuthStrategy {
125+ var strategies []authx.AuthStrategy
126+
125127 if strings .Contains (addr , ":" ) {
126128 // default normalization for host:port
127129 host , port , err := net .SplitHostPort (addr )
@@ -131,15 +133,16 @@ func (f *FileAuthProvider) LookupAddr(addr string) []authx.AuthStrategy {
131133 }
132134 for domain , strategy := range f .domains {
133135 if strings .EqualFold (domain , addr ) {
134- return strategy
136+ strategies = append ( strategies , strategy ... )
135137 }
136138 }
137139 for compiled , strategy := range f .compiled {
138140 if compiled .MatchString (addr ) {
139- return strategy
141+ strategies = append ( strategies , strategy ... )
140142 }
141143 }
142- return nil
144+
145+ return strategies
143146}
144147
145148// LookupURL looks up a given URL and returns appropriate auth strategy
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ func NewMultiAuthProvider(providers ...AuthProvider) AuthProvider {
2222func (m * MultiAuthProvider ) LookupAddr (host string ) []authx.AuthStrategy {
2323 for _ , provider := range m .Providers {
2424 strategy := provider .LookupAddr (host )
25- if strategy != nil {
25+ if len ( strategy ) > 0 {
2626 return strategy
2727 }
2828 }
You can’t perform that action at this time.
0 commit comments