mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-09-08 22:24:18 +08:00
INWX: use domain ACE encoding as cache key (#3519)
This commit is contained in:
parent
03932c9c1a
commit
07ffb3ab58
1 changed files with 9 additions and 1 deletions
|
@ -12,6 +12,7 @@ import (
|
|||
"github.com/fatih/color"
|
||||
"github.com/nrdcg/goinwx"
|
||||
"github.com/pquerna/otp/totp"
|
||||
"golang.org/x/net/idna"
|
||||
|
||||
"github.com/StackExchange/dnscontrol/v4/models"
|
||||
"github.com/StackExchange/dnscontrol/v4/pkg/diff2"
|
||||
|
@ -566,7 +567,14 @@ func (api *inwxAPI) fetchNameserverDomains() error {
|
|||
return err
|
||||
}
|
||||
for _, domain := range info.Domains {
|
||||
zones[domain.Domain] = domain.RoID
|
||||
// If this is an IDN domain, Nameservers.List.Domains[].Domain
|
||||
// will contain the Unicode name but subsequent calls use the ACE
|
||||
// encoded name. We will convert it now for use as the cache key
|
||||
aceName, err := idna.ToASCII(domain.Domain)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
zones[aceName] = domain.RoID
|
||||
}
|
||||
if len(zones) >= info.Count {
|
||||
break
|
||||
|
|
Loading…
Add table
Reference in a new issue