Skip to content

Commit

Permalink
fix: ⚡ catch panic if no dot in string
Browse files Browse the repository at this point in the history
  • Loading branch information
titigmr committed Jul 2, 2024
1 parent ba5ff96 commit 49b6278
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion midaas/midaas.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ func NewMiDaasProvider(WsUrl string, tsig []TSIGCredentials, domainFilter endpoi
func GetAvailableZones(dnsSuffix string, domainFilter *endpoint.DomainFilter, tsig *[]TSIGCredentials) *endpoint.DomainFilter {
filters := &domainFilter.Filters
for _, config := range *tsig {
zone := fmt.Sprintf("%v.%v", strings.Split(config.Keyname, ".")[1], dnsSuffix)
ss := strings.Split(config.Keyname, ".")
zone := fmt.Sprintf("%v.%v", ss[len(ss)-1], dnsSuffix)
log.WithField("zone", zone).Info("Successfully parsed zones")
*filters = append(*filters, zone)
}
Expand Down

0 comments on commit 49b6278

Please sign in to comment.